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 |

Linear Regression Reversal Indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Putt4Dough
Posted : Sunday, June 24, 2012 8:57:28 AM

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!

Bruce_L
Posted : Monday, June 25, 2012 9:37:42 AM


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
Putt4Dough
Posted : Monday, June 25, 2012 9:54:21 AM

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.

Bruce_L
Posted : Monday, June 25, 2012 9:59:46 AM


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
Putt4Dough
Posted : Friday, June 29, 2012 10:40:46 AM

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.

 

 

Bruce_L
Posted : Friday, June 29, 2012 11:37:15 AM


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
Putt4Dough
Posted : Friday, June 29, 2012 11:41:06 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Sweet!

BobMc
Posted : Sunday, July 8, 2012 3:33:09 PM
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

Putt4Dough
Posted : Sunday, July 8, 2012 4:29:02 PM

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

Bruce_L
Posted : Monday, July 9, 2012 10:21:49 AM


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
Putt4Dough
Posted : Monday, July 9, 2012 10:27:30 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks Bruce.

BobMc
Posted : Monday, July 9, 2012 12:11:59 PM
Registered User
Joined: 10/7/2004
Posts: 816

Thanks from me too

 

Regards

 

Bob Mc

Putt4Dough
Posted : Wednesday, August 1, 2012 8:49:22 PM

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!

Bruce_L
Posted : Thursday, August 2, 2012 7:52:41 AM


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
Putt4Dough
Posted : Thursday, August 2, 2012 7:58:00 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks again Bruce!

Putt4Dough
Posted : Sunday, January 27, 2013 11:21:18 AM

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!

Bruce_L
Posted : Monday, January 28, 2013 10:41:28 AM


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
Putt4Dough
Posted : Monday, January 28, 2013 10:58:13 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Bruce, you're the best!

Putt4Dough
Posted : Sunday, June 29, 2014 2:23:55 PM

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!!
Bruce_L
Posted : Monday, June 30, 2014 10:49:39 AM


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
Putt4Dough
Posted : Wednesday, December 30, 2015 4:25:18 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Hi Bruce, can you create a 30-period version? Thanks!

Bruce_L
Posted : Wednesday, December 30, 2015 4:37:49 PM


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
Putt4Dough
Posted : Wednesday, December 30, 2015 4:47:06 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Awesome, Bruce. Thanks. Happy New Year!!

Bruce_L
Posted : Wednesday, December 30, 2015 4:49:52 PM


Worden Trainer

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

You're welcome. Happy New Year!



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