Registered User Joined: 7/30/2007 Posts: 1,072
|
Bruce,
I recently added a 5-period Linear Regression Indicator to my chart using the "off-the-shelf" Moving Lin Reg Indicator ...
... which is basically the same as ...
What I'd like to do next is create a "Linear Regression Reversal Indicator" which plots a +1 when the 5-period linear regression direction is up and a -1 when prices reverse and the 5-period linear regression direction moves down...
I'm assuming the simplest way to do this is with a Custom PCF Indicator, but PCFs aren't my strong suit, and I could use a little help with the PCF needed to plot this indicator.
Thanks!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try using one of the following Indicator Formulas in your Custom PCF Indicator:
SGN(AVGC5 + 2 * (2 * C + C1 - C3 - 2 * C4) / 10 - AVGC5.1 - 2 * (2 * C1 + C2 - C4 - 2 * C5) / 10)
Or the shorter:
SGN(3 * C - C1 - C2 - C3 - C4 + C5)
Or the even shorter:
SGN(3 * C - 4 * AVGC4.1 + C5)
Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
I dunno if my fingers can take all that typing, Bruce ... can't you make it a little shorter? ;)
Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I can't think of a way to shorten it. I only provided all three versions so you could see how the basic idea of how the formula started and how it developed into the shortest posted version.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Hi Bruce, one more request for today...
Earlier in the week you wrote the above Indicator Formulas for a 5-period "Linear Regression Reversal Custom PCF Indicator".
Can I bother you for the 8-period, 13-period, and 21-period versions?
Thanks again.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
8-Period:
SGN(5 * C - 7 * AVGC7.1 + 2 * C8)
13-Period:
SGN(25 * C - 36 * AVGC12.1 + 11 * C13)
21-Period:
SGN(41 * C - 60 * AVGC20.1 + 19 * C21)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Sweet!
|
|
Registered User Joined: 10/7/2004 Posts: 816
|
Hi Bruce,
I was trying to plot these 4 indicators and I had a problem with the 8 period one.
While it looks similar to the other 3 - the plot is a flatline at 1 and the range shows 1 to 1.10
Could you review that one for me.
Also, is it possible to tab indicators to the side of the chart?
Regards and thanks
Bob Mc
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
QUOTE (BobMc) I was trying to plot these 4 indicators and I had a problem with the 8 period one.
While it looks similar to the other 3 - the plot is a flatline at 1 and the range shows 1 to 1.10
Bruce, I'm getting the same results; looks like there might be something hinky with the 8-period PCF...
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I have corrected the formula above. It should have been obvious to me that it was wrong when I posted it as the sum of the coefficients should add up to zero (and 5 - 7 + 3 = 1).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Thanks Bruce.
|
|
Registered User Joined: 10/7/2004 Posts: 816
|
Thanks from me too
Regards
Bob Mc
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Hi Bruce,
When you have a chance, can you please whip up 34-period and 55-period versions?
Thanks!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
34-Period:
SGN(67 * C - 99 * AVGC33.1 + 32 * C34)
55-Period:
SGN(109 * C - 162 * AVGC54.1 + 53 * C55)
You may also want to go back and take a look at my Friday, June 29, 2012 11:37:15 AM ET post as I've made some adjustments to it as well.
I have figured out a relatively quick way to make these formulas.
SGN((2 * period - 1) * C - 3 * (period - 1) * AVGCperiod.1 + (period - 2) * Cperiod)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Thanks again Bruce!
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Hi Bruce,
Up to now I've asked for PCFs based on Fibs (5, 8, 13, 21, 34, 55).
This time I have a single "non-fib" request.
Can you please write a PCF for a 65-Period "Linear Regression Reversal Custom PCF Indicator"?
(It's a long story; I won't bore you with the details).
Thanks!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
65-Period:
SGN(129 * C - 192 * AVGC64.1 + 63 * C65)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Bruce, you're the best!
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Hi Bruce,
When you have a moment can you please write a PCF for a 50-Period "Linear Regression Reversal Custom PCF Indicator"?
Thanks!!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following Indicator Formula.
SGN(99 * C - 147 * AVGC50.1 + 48 * C50)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Hi Bruce, can you create a 30-period version? Thanks!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can use the template given in my Thursday, August 02, 2012 7:52:41 AM ET post to create these on your own.
SGN((2 * period - 1) * C - 3 * (period - 1) * AVGCperiod.1 + (period - 2) * Cperiod)
SGN((2 * 30 - 1) * C - 3 * (30 - 1) * AVGC30.1 + (30 - 2) * C30)
SGN(59 * C - 87 * AVGC30.1 + 28) * C30)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/30/2007 Posts: 1,072
|
Awesome, Bruce. Thanks. Happy New Year!!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome. Happy New Year!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |