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

Linear Regression Code Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
HarleyBD
Posted : Thursday, September 27, 2018 10:27:37 AM
Platinum Customer Platinum Customer

Joined: 6/30/2014
Posts: 60

Hi Bruce,

I coded, what I thought was, Linear Regression Slope for 1 yr:
 

     6 * (FAVGC250.1 - AVGC250.1) / (250 - 1)

While it is allowing me to look at yearly bullish or bearish stocks, the idividual stock's sloping LinReg line seems to be different.  Is this code correct for yearly Linear Regression?  

Best Regards

 

Bruce_L
Posted : Thursday, September 27, 2018 11:53:16 AM


Worden Trainer

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

That would be the linear regression line from one bar ago instead of the current bar. The following is what you would need to use to match a current 250 period linear regression as line plotted on the chart.

6 * (FAVGC250 - AVGC250) / (250 - 1)

Which could be simplified ever so slightly to the following:

2 * (FAVGC250 - AVGC250) / 83

If this still isn't matching up with what you are expecting, could you provide some specific examples?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
HarleyBD
Posted : Thursday, September 27, 2018 12:13:45 PM
Platinum Customer Platinum Customer

Joined: 6/30/2014
Posts: 60

I will check back, later.  Thanks.

As always, Thanks Bruce (and the whole team).
 

It's a great system.

Bruce_L
Posted : Thursday, September 27, 2018 12:21:55 PM


Worden Trainer

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

You're welcome.



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