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 |

35n Linear Regression slope Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jynkin
Posted : Monday, November 28, 2005 10:51:07 AM
Registered User
Joined: 10/7/2004
Posts: 286
I need a formula for 35n linear regression slope to cover a 5 day period on my hourly charts. I have the LR30 slope;

((14.5 * C + 13.5 * C1 + 12.5 * C2 + 11.5 * C3 + 10.5 * C4 + 9.5 * C5 + 8.5 * C6 + 7.5 * C7 + 6.5 * C8 + 5.5 * C9 + 4.5 * C10 + 3.5 * C11 + 2.5 * C12 + 1.5 * C13 + 0.5 * C14 - 0.5 * C15 - 1.5 * C16 - 2.5 * C17 - 3.5 * C18 - 4.5 * C19 - 5.5 * C20 - 6.5 * C21 - 7.5 * C22 - 8.5 * C23 - 9.5 * C24 - 10.5 * C25 - 11.5 * C26 - 12.5 * C27 - 13.5 * C28 - 14.5 * C29) / 2247.5)

...but am not able to translate it over to the 35n.

thanks,
jynkin
Bruce_L
Posted : Monday, November 28, 2005 11:01:06 AM


Worden Trainer

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

(17 * C + 16 * C1 + 15 * C2 + 14 * C3 + 13 * C4 + 12 * C5 + 11 * C6 + 10 * C7 + 9 * C8 + 8 * C9 + 7 * C10 + 6 * C11 + 5 * C12 + 4 * C13 + 3 * C14 + 2 * C15 + C16 - C18 - 2 * C19 - 3 * C20 - 4 * C21 - 5 * C22 - 6 * C23 - 7 * C24 - 8 * C25 - 9 * C26 - 10 * C27 - 11 * C28 - 12 * C29 - 13 * C30 - 14 * C31 - 15 * C32 - 16 * C33 - 17 * C34) / 3570

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jynkin
Posted : Monday, November 28, 2005 11:04:22 AM
Registered User
Joined: 10/7/2004
Posts: 286
thanks...j
Bruce_L
Posted : Monday, November 28, 2005 11:05:48 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
markacz
Posted : Monday, November 28, 2005 5:14:35 PM
Platinum Customer Platinum Customer

Joined: 5/4/2005
Posts: 74
QUOTE (Bruce_L)
Try this:

(17 * C + 16 * C1 + 15 * C2 + 14 * C3 + 13 * C4 + 12 * C5 + 11 * C6 + 10 * C7 + 9 * C8 + 8 * C9 + 7 * C10 + 6 * C11 + 5 * C12 + 4 * C13 + 3 * C14 + 2 * C15 + C16 - C18 - 2 * C19 - 3 * C20 - 4 * C21 - 5 * C22 - 6 * C23 - 7 * C24 - 8 * C25 - 9 * C26 - 10 * C27 - 11 * C28 - 12 * C29 - 13 * C30 - 14 * C31 - 15 * C32 - 16 * C33 - 17 * C34) / 3570

Bruce: Just curious ... is this truly a linear slope? Is it derived from minimum mean squared error?
markacz
Bruce_L
Posted : Monday, November 28, 2005 5:46:10 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
markacz,
Yes.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jynkin
Posted : Tuesday, November 29, 2005 1:23:58 PM
Registered User
Joined: 10/7/2004
Posts: 286
Is the follow formula correct for the 35 day variance? ...or does the last number need to be 35 rather than 20?


(4 * SQR( ( ( C * C + C1 * C1 + C2 * C2 + C3 * C3 + C4 * C4 + C5 * C5 + C6 * C6 + C7 * C7 + C8 * C8 + C9 * C9 + C10 * C10 + C11 * C11 + C12 * C12 + C13 * C13 + C14 * C14 + C15 * C15 + C16 * C16 + C17 * C17 + C18 * C18 + C19 * C19+ C20 * C20 + C21 * C21 + C22 * C22 + C23 * C23 + C24 * C24 + C25 * C25 + C26 * C26 + C27 * C27 + C28 * C28 + C29 * C29+ C30 * C30 + C31 * C31 + C32 * C32 + C33 * C33 + C34 * C34) - 35 * AVGC35 * AVGC35 ) / 20 ))
Bruce_L
Posted : Tuesday, November 29, 2005 1:42:49 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Your formula appears to be 4 times the Standard Deviation (which is the Square Root of Variance) and would require either a 34 ( N-1 ) or a 35 ( N ) instead of 20. The following is what I come up with for Variance (re-arranged slightly from your form because it works a bit better in intraday timeframes for inactive stocks):

((C-AVGC35)^2 +(C1-AVGC35)^2 +(C2-AVGC35)^2 +(C3-AVGC35)^2 +(C4-AVGC35)^2 +(C5-AVGC35)^2 +(C6-AVGC35)^2 +(C7-AVGC35)^2 +(C8-AVGC35)^2 +(C9-AVGC35)^2 +(C10-AVGC35)^2 +(C11-AVGC35)^2 +(C12-AVGC35)^2 +(C13-AVGC35)^2 +(C14-AVGC35)^2 +(C15-AVGC35)^2 +(C16-AVGC35)^2 +(C17-AVGC35)^2 +(C18-AVGC35)^2 +(C19-AVGC35)^2 +(C20-AVGC35)^2 +(C21-AVGC35)^2 +(C22-AVGC35)^2 +(C23-AVGC35)^2 +(C24-AVGC35)^2 +(C25-AVGC35)^2 +(C26-AVGC35)^2 +(C27-AVGC35)^2 +(C28-AVGC35)^2 +(C29-AVGC35)^2 +(C30-AVGC35)^2 +(C31-AVGC35)^2 +(C32-AVGC35)^2 +(C33-AVGC35)^2 +(C34-AVGC35)^2)/34

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jynkin
Posted : Tuesday, November 29, 2005 1:57:12 PM
Registered User
Joined: 10/7/2004
Posts: 286
thanks...j
Bruce_L
Posted : Tuesday, November 29, 2005 2:02:07 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jynkin
Posted : Tuesday, November 29, 2005 2:42:12 PM
Registered User
Joined: 10/7/2004
Posts: 286
My 56n Linear Regression SLOPE formula doesn't the right numbers, but I can't seem to figure out what's wrong with it. ?? ....thanks jynkin


(28.5 * C + 27.5 * C1 + 26.5 * C2 + 25.5 * C3 + 24.5 * C4 + 23.5 * C5 + 22.5 * C6 + 21.5 * C7 + 20.5 * C8 + 19.5 * C9 + 18.5 * C10 + 17.5 * C11 + 16.5 * C12 + 15.5 * C13 + 14.5 * C14 + 13.5 * C15 + 12.5 * C16 + 11.5 * C17 + 10.5 * C18 + 9.5 * C19 + 8.5 * C20 + 7.5 * C21 + 6.5 * C22 + 5.5 * C23 + 4.5 * C24 + 3.5 * C25 + 2.5 * C26 + 1.5 * C27 + 0.5 * C28 - 0.5 * C29 - 1.5 * C30 - 2.5 * C31 - 3.5 * C32 - 4.5 * C33 - 5.5 * C34 - 6.5 * C35 - 7.5 * C36 - 8.5 * C37 - 9.5 * C38 - 10.5 * C39 - 11.5 * C40 - 12.5 * C41 - 13.5 * C42 - 14.5 * C43 - 15.5 * C44 - 16.5 * C45 - 17.5 * C46 - 18.5 * C47 - 19.5 * C48 - 20.5 * C49 - 21.5 * C50 - 22.5 * C51 - 23.5 * C52 - 26.5 * C53 - 27.5 * C54 - 28.5 * C55) / 14630
jynkin
Posted : Tuesday, November 29, 2005 2:55:11 PM
Registered User
Joined: 10/7/2004
Posts: 286
...figured it out, had a few numbers out of sequence. This one works.


(27.5 * C + 26.5 * C1 + 25.5 * C2 + 24.5 * C3 + 23.5 * C4 + 22.5 * C5 + 21.5 * C6 + 20.5 * C7 + 19.5 * C8 + 18.5 * C9 + 17.5 * C10 + 16.5 * C11 + 15.5 * C12 + 14.5 * C13 + 13.5 * C14 + 12.5 * C15 + 11.5 * C16 + 10.5 * C17 + 9.5 * C18 + 8.5 * C19 + 7.5 * C20 + 6.5 * C21 + 5.5 * C22 + 4.5 * C23 + 3.5 * C24 + 2.5 * C25 + 1.5 * C26 + 0.5 * C27 - 0.5 * C28 - 1.5 * C29 - 2.5 * C30 - 3.5 * C31 - 4.5 * C32 - 5.5 * C33 - 6.5 * C34 - 7.5 * C35 - 8.5 * C36 - 9.5 * C37 - 10.5 * C38 - 11.5 * C39 - 12.5 * C40 - 13.5 * C41 - 14.5 * C42 - 15.5 * C43 - 16.5 * C44 - 17.5 * C45 - 18.5 * C46 - 19.5 * C47 - 20.5 * C48 - 21.5 * C49 - 22.5 * C50 - 23.5 * C51 - 24.5 * C52 - 25.5 * C53 - 26.5 * C54 - 27.5 * C55) / 14630
Bruce_L
Posted : Tuesday, November 29, 2005 2:57:06 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Great! I'm glad you were able to figure it out on your own.

-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.