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 and Linear Regression Slope Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Bruce_L
Posted : Tuesday, March 7, 2017 3:45:19 PM


Worden Trainer

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

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
traderc
Posted : Sunday, March 12, 2017 2:00:53 PM
Registered User
Joined: 10/7/2004
Posts: 86

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

Bruce_L
Posted : Monday, March 13, 2017 10:18:21 AM


Worden Trainer

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

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
traderc
Posted : Tuesday, March 14, 2017 4:04:49 PM
Registered User
Joined: 10/7/2004
Posts: 86

thank you Bruce

Bruce_L
Posted : Tuesday, March 14, 2017 4:07:38 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.