Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Moving Linear Regression Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Palmbeachtrader
Posted : Tuesday, December 6, 2016 6:11:58 PM
Platinum Customer Platinum Customer

Joined: 10/8/2011
Posts: 13

Could you provide the formula for a 375 period moving linear regression line......Thanks

Bruce_L
Posted : Thursday, December 8, 2016 9:41:51 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

This formula should be getting a lot shorter soon.

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis

AVGC375 + 187 * (187 * C + 186 * C1 + 185 * C2 + 184 * C3 + 183 * C4 + 182 * C5 + 181 * C6 + 180 * C7 + 179 * C8 + 178 * C9 + 177 * C10 + 176 * C11 + 175 * C12 + 174 * C13 + 173 * C14 + 172 * C15 + 171 * C16 + 170 * C17 + 169 * C18 + 168 * C19 + 167 * C20 + 166 * C21 + 165 * C22 + 164 * C23 + 163 * C24 + 162 * C25 + 161 * C26 + 160 * C27 + 159 * C28 + 158 * C29 + 157 * C30 + 156 * C31 + 155 * C32 + 154 * C33 + 153 * C34 + 152 * C35 + 151 * C36 + 150 * C37 + 149 * C38 + 148 * C39 + 147 * C40 + 146 * C41 + 145 * C42 + 144 * C43 + 143 * C44 + 142 * C45 + 141 * C46 + 140 * C47 + 139 * C48 + 138 * C49 + 137 * C50 + 136 * C51 + 135 * C52 + 134 * C53 + 133 * C54 + 132 * C55 + 131 * C56 + 130 * C57 + 129 * C58 + 128 * C59 + 127 * C60 + 126 * C61 + 125 * C62 + 124 * C63 + 123 * C64 + 122 * C65 + 121 * C66 + 120 * C67 + 119 * C68 + 118 * C69 + 117 * C70 + 116 * C71 + 115 * C72 + 114 * C73 + 113 * C74 + 112 * C75 + 111 * C76 + 110 * C77 + 109 * C78 + 108 * C79 + 107 * C80 + 106 * C81 + 105 * C82 + 104 * C83 + 103 * C84 + 102 * C85 + 101 * C86 + 100 * C87 + 99 * C88 + 98 * C89 + 97 * C90 + 96 * C91 + 95 * C92 + 94 * C93 + 93 * C94 + 92 * C95 + 91 * C96 + 90 * C97 + 89 * C98 + 88 * C99 + 87 * C100 + 86 * C101 + 85 * C102 + 84 * C103 + 83 * C104 + 82 * C105 + 81 * C106 + 80 * C107 + 79 * C108 + 78 * C109 + 77 * C110 + 76 * C111 + 75 * C112 + 74 * C113 + 73 * C114 + 72 * C115 + 71 * C116 + 70 * C117 + 69 * C118 + 68 * C119 + 67 * C120 + 66 * C121 + 65 * C122 + 64 * C123 + 63 * C124 + 62 * C125 + 61 * C126 + 60 * C127 + 59 * C128 + 58 * C129 + 57 * C130 + 56 * C131 + 55 * C132 + 54 * C133 + 53 * C134 + 52 * C135 + 51 * C136 + 50 * C137 + 49 * C138 + 48 * C139 + 47 * C140 + 46 * C141 + 45 * C142 + 44 * C143 + 43 * C144 + 42 * C145 + 41 * C146 + 40 * C147 + 39 * C148 + 38 * C149 + 37 * C150 + 36 * C151 + 35 * C152 + 34 * C153 + 33 * C154 + 32 * C155 + 31 * C156 + 30 * C157 + 29 * C158 + 28 * C159 + 27 * C160 + 26 * C161 + 25 * C162 + 24 * C163 + 23 * C164 + 22 * C165 + 21 * C166 + 20 * C167 + 19 * C168 + 18 * C169 + 17 * C170 + 16 * C171 + 15 * C172 + 14 * C173 + 13 * C174 + 12 * C175 + 11 * C176 + 10 * C177 + 9 * C178 + 8 * C179 + 7 * C180 + 6 * C181 + 5 * C182 + 4 * C183 + 3 * C184 + 2 * C185 + C186 - C188 - 2 * C189 - 3 * C190 - 4 * C191 - 5 * C192 - 6 * C193 - 7 * C194 - 8 * C195 - 9 * C196 - 10 * C197 - 11 * C198 - 12 * C199 - 13 * C200 - 14 * C201 - 15 * C202 - 16 * C203 - 17 * C204 - 18 * C205 - 19 * C206 - 20 * C207 - 21 * C208 - 22 * C209 - 23 * C210 - 24 * C211 - 25 * C212 - 26 * C213 - 27 * C214 - 28 * C215 - 29 * C216 - 30 * C217 - 31 * C218 - 32 * C219 - 33 * C220 - 34 * C221 - 35 * C222 - 36 * C223 - 37 * C224 - 38 * C225 - 39 * C226 - 40 * C227 - 41 * C228 - 42 * C229 - 43 * C230 - 44 * C231 - 45 * C232 - 46 * C233 - 47 * C234 - 48 * C235 - 49 * C236 - 50 * C237 - 51 * C238 - 52 * C239 - 53 * C240 - 54 * C241 - 55 * C242 - 56 * C243 - 57 * C244 - 58 * C245 - 59 * C246 - 60 * C247 - 61 * C248 - 62 * C249 - 63 * C250 - 64 * C251 - 65 * C252 - 66 * C253 - 67 * C254 - 68 * C255 - 69 * C256 - 70 * C257 - 71 * C258 - 72 * C259 - 73 * C260 - 74 * C261 - 75 * C262 - 76 * C263 - 77 * C264 - 78 * C265 - 79 * C266 - 80 * C267 - 81 * C268 - 82 * C269 - 83 * C270 - 84 * C271 - 85 * C272 - 86 * C273 - 87 * C274 - 88 * C275 - 89 * C276 - 90 * C277 - 91 * C278 - 92 * C279 - 93 * C280 - 94 * C281 - 95 * C282 - 96 * C283 - 97 * C284 - 98 * C285 - 99 * C286 - 100 * C287 - 101 * C288 - 102 * C289 - 103 * C290 - 104 * C291 - 105 * C292 - 106 * C293 - 107 * C294 - 108 * C295 - 109 * C296 - 110 * C297 - 111 * C298 - 112 * C299 - 113 * C300 - 114 * C301 - 115 * C302 - 116 * C303 - 117 * C304 - 118 * C305 - 119 * C306 - 120 * C307 - 121 * C308 - 122 * C309 - 123 * C310 - 124 * C311 - 125 * C312 - 126 * C313 - 127 * C314 - 128 * C315 - 129 * C316 - 130 * C317 - 131 * C318 - 132 * C319 - 133 * C320 - 134 * C321 - 135 * C322 - 136 * C323 - 137 * C324 - 138 * C325 - 139 * C326 - 140 * C327 - 141 * C328 - 142 * C329 - 143 * C330 - 144 * C331 - 145 * C332 - 146 * C333 - 147 * C334 - 148 * C335 - 149 * C336 - 150 * C337 - 151 * C338 - 152 * C339 - 153 * C340 - 154 * C341 - 155 * C342 - 156 * C343 - 157 * C344 - 158 * C345 - 159 * C346 - 160 * C347 - 161 * C348 - 162 * C349 - 163 * C350 - 164 * C351 - 165 * C352 - 166 * C353 - 167 * C354 - 168 * C355 - 169 * C356 - 170 * C357 - 171 * C358 - 172 * C359 - 173 * C360 - 174 * C361 - 175 * C362 - 176 * C363 - 177 * C364 - 178 * C365 - 179 * C366 - 180 * C367 - 181 * C368 - 182 * C369 - 183 * C370 - 184 * C371 - 185 * C372 - 186 * C373 - 187 * C374) / 4394500



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Palmbeachtrader
Posted : Thursday, December 8, 2016 2:33:20 PM
Platinum Customer Platinum Customer

Joined: 10/8/2011
Posts: 13

Thank You Bruce

Palmbeachtrader
Posted : Thursday, December 8, 2016 2:45:02 PM
Platinum Customer Platinum Customer

Joined: 10/8/2011
Posts: 13

Bruce, I just copied the formula you provided into a new pcf and it says there is a syntax error.

Bruce_L
Posted : Thursday, December 8, 2016 2:47:27 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Try copying and pasting the formula into a text editor such as Notepad (not a word processor like Word) and then copying and pasting from the text editor into TC2000.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
Posted : Thursday, December 8, 2016 3:02:07 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

QUOTE (Bruce_L)

This formula should be getting a lot shorter soon.

 

Is new PCF language on the way?

 

Thanks

 

Bruce_L
Posted : Thursday, December 8, 2016 3:13:22 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Improvements to the existing Personal Criteria Formula Language are on the way. So far everything seems completely backwards compatible with existing formulas and I would expect it to remain that way.

Quite a few indicators / features are being added. I don't actually know all of the feature changes that will be implemented because it is a work in progress.

Let's take this the above formula as example. In the current internal testing build I would write the above formula as follows.

6 * (FAVGC375 - AVGC375) / 374

That isn't going to work in the production build currently available to customers and the syntax might change, but that is as short as I can get it now in the existing testing build. Obviously if moving linear regression gets added as one of the indicators with its own syntax, it would end up being even shorter (probably just MLR375).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Palmbeachtrader
Posted : Thursday, December 8, 2016 3:23:06 PM
Platinum Customer Platinum Customer

Joined: 10/8/2011
Posts: 13

I finally got it to work and display......Thanks

Bruce_L
Posted : Thursday, December 8, 2016 3:32:49 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.