Gold Customer
Joined: 6/23/2010 Posts: 8

I am trying to write a pcf for the percentage change (not annualized) of a 6 period linear regression line applied to a 20 period simple moving average. Can you tell me if this formula is correct?
100 * (EXP((2.5 * LOG(AVGC20 ) + 1.5 * LOG(AVGC20.1) + .5 * LOG(AVGC20.2)  .5 * LOG(AVGC20.3)  1.5 * LOG(AVGC20.4)  2.5 * LOG(AVGC20.5)) / 17.5)  1)
Thank you

Worden Trainer
Joined: 10/7/2004 Posts: 58,655

If you aren't trying to annualize it and are using TC2000 v17, you could use the following.
AVG(3 * FAVGC6  2 * AVGC6, 20)
Note that the 6 period moving linear regression of the 20 period simple moving average is the same as the 20 period simple moving average of the 6 period moving linear regression which is why were able to write the formula as given above. This is slightly shorter than writing it the other way round.
3 * FAVG(AVGC20, 6)  2 * AVG(AVGC20, 6)
This could be written as follows in earlier versions of TC2000.
AVG(AVGC20, 6) + 2.5 * (2.5 * AVGC20 + 1.5 * AVGC20.1 + .5 * AVGC20.2  .5 * AVGC20.3  1.5 * AVGC20.4  2.5 * AVGC20.5) / 17.5
Bruce Personal Criteria Formulas TC2000 Support Articles

Gold Customer
Joined: 6/23/2010 Posts: 8

Thanks Bruce.
Can you also tell me the PCF for the start and end points for a standard (nonmoving) linear regression line? For example, a linear regression line applied to 20 bars of price history.
I’m thinking the starting point is the C of 20 bars ago?? I am having a hard time interpreting these formulas.

Worden Trainer
Joined: 10/7/2004 Posts: 58,655

The starting point of a 20 period linear regression line is actually 19 bars ago since it is 20 bars long and includes the current bar (which is 0 bars ago).
The left end point (starting point) of a 20 period linear regression line of price will have the following value.
4 * AVGC20  3 * FAVGC20
And the right end point of a 20 period linear regerssion line of price will have the following value.
3 * FAVGC20  2 * AVGC20
Bruce Personal Criteria Formulas TC2000 Support Articles

Gold Customer
Joined: 6/23/2010 Posts: 8

Perfect  Thank you Bruce

Worden Trainer
Joined: 10/7/2004 Posts: 58,655

You're welcome.
Bruce Personal Criteria Formulas TC2000 Support Articles
