Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 286
|
I want a u]PCF for the 20d Linear Regression value. I have the following formula for the 30day Linear Regression value, but not sure how to translate it into a 20d Linear Regression PCF.
I don't know what to do with the denominator especially.?? ...and the 465 number?? Don't remember how I came up with these, but they work.
AVGC30 + 14.5 * ((C29 + 2 * C28 + 3 * C27 + 4 * C26 + 5 * C25 + 6 * C24 + 7 * C23 + 8 * C22 + 9 * C21 + 10 * C20 + 11 * C19 + 12 * C18 + 13 * C17 + 14 * C16 + 15 * C15 + 16 * C14 + 17 * C13 + 18 * C12 + 19 * C11 + 20 * C10 + 21 * C9 + 22 * C8 + 23 * C7 + 24 * C6 + 25 * C5 + 26 * C4 + 27 * C3 + 28 * C2 + 29 * C1 + 30 * C) - 465 * AVGC30) / 2247.5
thanks, jynkin
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Try this:
AVGC20 + 9.5 * (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
You may be interested in the following forum topic:
Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/7/2005 Posts: 23
|
Bruce,
Could you explain where your numbers came from?
Thanks!
Rob
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The forum topic I mentioned will give a more detailed explanation, but:
The slope is determined by incrementing the coefficient for each of the closes during the Linear Regression period by negative one, adding up the results and dividing by the sum of the squares of the coefficients (the first coefficient is the number of periods since the midpoint of the Linear Regression):
(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
The slope is multiplied by the number of periods since the midpoint of the Linear Regression (9.5) and added to the value of the midpoint of the Linear Regression (AVGC20) to get the endpoint of the Linear Regression (the current value).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 286
|
One more Bruce....
What would the 56d Linear Regression PCF look like? Especially the denominator, I can translate the rest from the above; although if you have the whole formula and can cut and paste it here, that would be great.
thanks, jynkin
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Try this:
AVGC56 + 27.5 * (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 Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/2/2005 Posts: 132
|
Two questions:
Can I get a 25 day linear regression PCF please? If so, how can I then calculate the slope of that line inside a PCF?
I'm interested in creating an indicator that is a moving average of the slope of the 25 day linear regression. Any ideas would be greatly appreciated.
thanks, dhoward
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Try this for the Linear Regression:
AVGC25 + 12 * (12 * C + 11 * C1 + 10 * C2 + 9 * C3 + 8 * C4 + 7 * C5 + 6 * C6 + 5 * C7 + 4 * C8 + 3 * C9 + 2 * C10 + C11 - C13 - 2 * C14 - 3 * C15 - 4 * C16 - 5 * C17 - 6 * C18 - 7 * C19 - 8 * C20 - 9 * C21 - 10 * C22 - 11 * C23 - 12 * C24) / 1300
The slope is everything from the first parenthesis on. The following Custom Indicator should work for the indicator you want to create:
Select Chart Template | Add Indicator | Indicator. -Visible: Checked -Center Zero Line: Checked? (It's up to you.) -Plot using price scale: Unchecked -Smoothing Average: Set to the MA Period. -Smoothing Type: Simple or Exponential -Indicator Formula: (12 * C + 11 * C1 + 10 * C2 + 9 * C3 + 8 * C4 + 7 * C5 + 6 * C6 + 5 * C7 + 4 * C8 + 3 * C9 + 2 * C10 + C11 - C13 - 2 * C14 - 3 * C15 - 4 * C16 - 5 * C17 - 6 * C18 - 7 * C19 - 8 * C20 - 9 * C21 - 10 * C22 - 11 * C23 - 12 * C24) / 1300
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/2/2005 Posts: 132
|
Thanks a lot Bruce!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |