Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Linear Regresion PCF - 5 day , 10 day 20 day.........(visual Sort) Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
raymondlevy.zw
Posted : Sunday, March 18, 2012 9:11:51 PM
Registered User
Joined: 1/9/2012
Posts: 14

Hi Bruce,

I have spent hours and hours trying to figure out the LR PCF for 5 day, 10 day and 20 Day. 

Please can you help me build them.  I think i have figured out the formula for the most part, but there are a couple elements that i dont know how to calculate....

1.    the sum of the squares of the coefficents.

2.   Why you multiply the Formula by the number of periods.... Example (60,0,10 - Visual Slope)  Why do you multply the formula by 100 and the divide it by (MAXH62 - MINL62)>

Here is what i mean....

100 * (29.5 * C + 28.5 * C1 + 27.5 * C2 + 26.5 * C3 + 25.5 * C4 + 24.5 * C5 + 23.5 * C6 + 22.5 * C7 + 21.5 * C8 + 20.5 * C9 + 19.5 * C10 + 18.5 * C11 + 17.5 * C12 + 16.5 * C13 + 15.5 * C14 + 14.5 * C15 + 13.5 * C16 + 12.5 * C17 + 11.5 * C18 + 10.5 * C19 + 9.5 * C20 + 8.5 * C21 + 7.5 * C22 + 6.5 * C23 + 5.5 * C24 + 4.5 * C25 + 3.5 * C26 + 2.5 * C27 + 1.5 * C28 + 0.5 * C29 - 0.5 * C30 - 1.5 * C31 - 2.5 * C32 - 3.5 * C33 - 4.5 * C34 - 5.5 * C35 - 6.5 * C36 - 7.5 * C37 - 8.5 * C38 - 9.5 * C39 - 10.5 * C40 - 11.5 * C41 - 12.5 * C42 - 13.5 * C43 - 14.5 * C44 - 15.5 * C45 - 16.5 * C46 - 17.5 * C47 - 18.5 * C48 - 19.5 * C49 - 20.5 * C50 - 21.5 * C51 - 22.5 * C52 - 23.5 * C53 - 24.5 * C54 - 25.5 * C55 - 26.5 * C56 - 27.5 * C57 - 28.5 * C58 - 29.5 * C59) / 17995 / (MAXH62 - MINL62)

 

If you could, please can you help me write the formula for 5, 10 and 20 days.  I would love it if you could explain the above questions, that way i could build my own formulas in future.

Thanks.

Raymond

raymondlevy.zw
Posted : Sunday, March 18, 2012 11:43:57 PM
Registered User
Joined: 1/9/2012
Posts: 14

Hi Burce,..... ok a few hours later.... i figured out how to get the Sum of the Squares coefficient....but now i am REALLY confused....

 

I ran a formula for the 20 Period LInear Regression and this is what i got....

(9.5*C+8.5*C1+7.5*C2+6.5*C3+5.5*C4+4.5*C5+3.5*C6+2.5*C7+1.5*C8+0.5*C9+-0.5*C10+-1.5*C11+-2.5*C12+-3.5*C13+-4.5*C14+-5.5*C15+-6.5*C16+-7.5*C17+-8.5*C18+-9.5*C19)/665

 

So i ran an Easyscan.... and here are the two results that confuse me.....

 

1.  Test Result for FAST -

 

2. Test Result for VZ -

 

Same Exact Result.... However the Charts for that time period, using LInear Regression tool for that period tells a completely different Story....??

Look......at next post.....

raymondlevy.zw
Posted : Sunday, March 18, 2012 11:47:46 PM
Registered User
Joined: 1/9/2012
Posts: 14

Here are the chart pictures

raymondlevy.zw
Posted : Sunday, March 18, 2012 11:49:27 PM
Registered User
Joined: 1/9/2012
Posts: 14

raymondlevy.zw
Posted : Sunday, March 18, 2012 11:52:07 PM
Registered User
Joined: 1/9/2012
Posts: 14

My confusion is ....how can the Value returned be the same (0.08) and yet the angle of the Slope be so different? 

What am i missing.....?

Please help.......

 

My objective is to use the Linear Regression to do scan searches for SLOPE OF TREND (more or less - I know that big moves will skew the result.)


Please help.

Thnx

Bruce_L
Posted : Monday, March 19, 2012 12:28:18 PM


Worden Trainer

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

The reason both formulas return .08 is that the linear regression line for both goes up by about the same amount over those 20-bars:

FAST: (53.201 - 51.589) / 19 = 1.612 / 19 = .08484
VZ: (39.543 - 37.962) / 19 = 1.581 / 19 = .08321

 
If you want a formula for Visual Slope, you are missing the 100 * at the front and the / (MAXH22 - MINL22) at the end.
 
 
This allows you to calculate how far the Linear Regression Line goes up or down as a percentage of the range of price over 22-Bars.
 
So a 5-Period Visual Slope Sort formula would be:
 
100 * (2 * C + C1 - C3 - 2 * C4) / 10 / (MAXH7 - MINL7)
 
A 10-Period Visual Slope Sort formula would be:
 
100 * (4.5 * C + 3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8 - 4.5 * C9) / 82.5 / (MAXH12 - MINL12)
 
And a 20-Period Visual Slope Sort formula would be:
 
100 * (9.5 * C + 8.5 * C1 + 7.5 * C2 + 6.5 * C3 + 5.5 * C4 + 4.5 * C5 + 3.5 * C6 + 2.5 * C7 + 1.5 * C8 + .5 * C9 - .5 * C10 - 1.5 * C11 - 2.5 * C12 - 3.5 * C13 - 4.5 * C14 - 5.5 * C15 - 6.5 * C16 - 7.5 * C17 - 8.5 * C18 - 9.5 * C19) / 665 / (MAXH22 - MINL22)
 
It should be noted that 22-Bars is used only because adding 2 to the period of the Linear Regression Line matches the results of a Visual Slope calculation in TC2000 version 7. If you want to match the percentage of the range of the visible chart, you would need to substitute the number of bars visible on the chart for 22.
 
If you wanted to calculate the percentage of the price range of the visible portion of the charts given above, you would use a period of 46:
 
100 * (9.5 * C + 8.5 * C1 + 7.5 * C2 + 6.5 * C3 + 5.5 * C4 + 4.5 * C5 + 3.5 * C6 + 2.5 * C7 + 1.5 * C8 + .5 * C9 - .5 * C10 - 1.5 * C11 - 2.5 * C12 - 3.5 * C13 - 4.5 * C14 - 5.5 * C15 - 6.5 * C16 - 7.5 * C17 - 8.5 * C18 - 9.5 * C19) / 665 / (MAXH46 - MINL46)


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
raymondlevy.zw
Posted : Monday, March 19, 2012 12:42:44 PM
Registered User
Joined: 1/9/2012
Posts: 14

thnx for amazingly quick response.

raymondlevy.zw
Posted : Monday, March 19, 2012 12:54:51 PM
Registered User
Joined: 1/9/2012
Posts: 14

I just plugged in your  most recent Linear regression slope...

raymondlevy.zw
Posted : Monday, March 19, 2012 12:57:02 PM
Registered User
Joined: 1/9/2012
Posts: 14

So..... is ghthe Value of 4.67 the "percentage of the price range" between the High and low of the last 46 days?

I checked the change in the price... over that period, and is  far from 4.67%

Please can you explain...

 

thanx

Bruce_L
Posted : Monday, March 19, 2012 1:02:43 PM


Worden Trainer

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

It is a slope and it is per bar. If it is moving up 4.67% per bar, it is moving up 88.73% of the entire range of the chart over the course of the 20-Period Linear Regression.

If you want something that returns a value that is easy to understand and comparable no matter what the zoom or period of the Linear Regression Line, I might suggest a formula for the annualized growth rate of the linear regression line. The resulting value is the percent change you would get over a year if you extend the linear regression line that far.

A 5-Period Annualized Growth Rate formula could be written as:

100 * (EXP(253 * (2 * LOG(C ) + LOG(C1) - LOG(C3) - 2 * LOG(C4)) / 10) - 1)

A 10-Period Annualized Growth Rate formula could be written as:

100 * (EXP(253 * (4.5 * LOG(C ) + 3.5 * LOG(C1) + 2.5 * LOG(C2) + 1.5 * LOG(C3) + .5 * LOG(C4) - .5 * LOG(C5) - 1.5 * LOG(C6) - 2.5 * LOG(C7) - 3.5 * LOG(C8) - 4.5 * LOG(C9)) / 82.5) - 1)

And a 20-Period Annualized Growth Rate formula could be written as:

100 * (EXP(253 * (9.5 * LOG(C ) + 8.5 * LOG(C1) + 7.5 * LOG(C2) + 6.5 * LOG(C3) + 5.5 * LOG(C4) + 4.5 * LOG(C5) + 3.5 * LOG(C6) + 2.5 * LOG(C7) + 1.5 * LOG(C8) + .5 * LOG(C9) - .5 * LOG(C10) - 1.5 * LOG(C11) - 2.5 * LOG(C12) - 3.5 * LOG(C13) - 4.5 * LOG(C14) - 5.5 * LOG(C15) - 6.5 * LOG(C16) - 7.5 * LOG(C17) - 8.5 * LOG(C18) - 9.5 * LOG(C19)) / 665) - 1)



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