Worden Trainer
Joined: 10/7/2004 Posts: 61,012

Linear Regression and Linear Regression Slope
Templates (v17+)
Moving Linear Regression (or right endpoint of Linear Regression Line)
3 * FAVG(w, x)  2 * AVG(w, x)
Linear Regression Slope
6 * (FAVG(w, x)  AVG(w, x)) / (x  1)
Start of Linear Regression Line (or left endpoint)
4 * AVG(w, x)  3 * FAVG(w, x)
Where w can be any formula which returns a numeric value.
Where x is the period of the linear regression.
Examples
The 30 period moving linear regression can be written as follows.
3 * FAVGC30  2 * AVGC30
The 30 period linear regression slope can be written as follows.
6 * (FAVGC30  AVGC30) / 29
Related Topics
Bruce Personal Criteria Formulas TC2000 Support Articles

Gold Customer
Joined: 10/7/2004 Posts: 65

So Bruce, if I wanted to make a Linear Regression channel, 21 period & channel width 70 would it be:
Linear regression Slope(21) + 70 & linear Regression slope(21)  70.
Or would I use the Moving Linear regression formula.
Thanks
rctrade

Worden Trainer
Joined: 10/7/2004 Posts: 61,012

If you are trying to replicate the moving linear regression channels from TC2000 v7 in TC2000 v17, then the upper channel 21, 70 would be the following.
3 * FAVGC30  2 * AVGC30 + 70 * (ABS(C20  AVGC2.20) + ABS(C19  AVGC3.19) + ABS(C18  AVGC4.18) + ABS(C17  AVGC5.17) + ABS(C16  AVGC6.16) + ABS(C15  AVGC7.15) + ABS(C14  AVGC8.14) + ABS(C13  AVGC9.13) + ABS(C12  AVGC10.12) + ABS(C11  AVGC11.11) + ABS(C10  AVGC12.10) + ABS(C9  AVGC13.9) + ABS(C8  AVGC14.8) + ABS(C7  AVGC15.7) + ABS(C6  AVGC16.6) + ABS(C5  AVGC17.5) + ABS(C4  AVGC18.4) + ABS(C3  AVGC19.3) + ABS(C2  AVGC20.2) + ABS(C1  AVGC21.1) + ABS(C  AVGC22)) / 440
The center channel 21, 70 would be the following.
3 * FAVGC30  2 * AVGC30
And the lower channel 21, 70 would be the following.
3 * FAVGC30  2 * AVGC30  70 * (ABS(C20  AVGC2.20) + ABS(C19  AVGC3.19) + ABS(C18  AVGC4.18) + ABS(C17  AVGC5.17) + ABS(C16  AVGC6.16) + ABS(C15  AVGC7.15) + ABS(C14  AVGC8.14) + ABS(C13  AVGC9.13) + ABS(C12  AVGC10.12) + ABS(C11  AVGC11.11) + ABS(C10  AVGC12.10) + ABS(C9  AVGC13.9) + ABS(C8  AVGC14.8) + ABS(C7  AVGC15.7) + ABS(C6  AVGC16.6) + ABS(C5  AVGC17.5) + ABS(C4  AVGC18.4) + ABS(C3  AVGC19.3) + ABS(C2  AVGC20.2) + ABS(C1  AVGC21.1) + ABS(C  AVGC22)) / 440
Linear regression channel calculations
The new v17 syntax allows us to shorten the MLR portion of the formula, but not the channel portion.
Bruce Personal Criteria Formulas TC2000 Support Articles

Gold Customer
Joined: 10/7/2004 Posts: 65

thank you Bruce

Worden Trainer
Joined: 10/7/2004 Posts: 61,012

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