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 |

I need a custom study built for linear regression? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
seankozak77
Posted : Friday, January 6, 2012 1:24:12 PM
Registered User
Joined: 9/9/2011
Posts: 4
I currently use your platforms for scanning and several other charting functions. I know you offer a linear regression drawing tool which is simply a linear regression line, however i would like to know if you can build me the formula or code for a custom linear regression study for price.I would like to have for channel lines:outside line top = 100inside top = 50inside bottom = 50outside bottom = 100i really appreciate how you guys have helped me before with programming code so i hope you are able to assist me with this...Sincerely,Sean Kozak
Bruce_L
Posted : Friday, January 6, 2012 1:32:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
TC2000 version 7 has a Linear Regression (line) indicator which has channels.

TC2000 version 12 has a Reg Channel drawing tool with channels and a Linear Regression Line indicator without channels. I do not know of a way to add a Linear Regression Line with channels to TC2000 version 12.

It would be possible to add a Moving Linear Regression Channels indicator to TC2000 version 12 which would match the calculations in TC2000 version 7. The complete settings would need to be known however.

- Period: ?
- Extension: ?
- Point to Plot: ?
- Width: ?

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
Linear regression channel calculations

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
go4it
Posted : Saturday, July 7, 2012 12:38:18 PM
Registered User
Joined: 10/7/2004
Posts: 18

Bruce,

Regarding this topic, I am a long term TC user (since early 90's) and I'm very discouraged to hear you say that there is no way to add straignt linear regression channels to telchart 12. You know that is one of the best features of the old TC v7, and Don used channels a lot. So do I. Please ask the top programers if there is not a way to skin this cat.

But regarding the Moving linear regression channels... here are the parameters I would like:

Period:  30

Extension: 0

Point to plot: ?? I would suspect this would be the latest data point from which the calculations would look back x number of  chart units???? For me that setting would be 30.

Width: I traditionally used 2, 3 and 4 standard deviations on my straight regression channels. Is it possible to code "switchs" to turn these on/off buy changing a code parameter to null (0)? If it has to be set to one specific setting only, I would choose  +/- 3 s.d. , but an "on/off" switch would be good too.

 

Thanks, John Farrell

go4it on TC

go4it
Posted : Saturday, July 7, 2012 1:15:17 PM
Registered User
Joined: 10/7/2004
Posts: 18

Bruce,

 

While I'm at it I wanted to remind "the Worden's" of how frustrating it is to be  using a program for many years then all of the sudden have it go through 3 complete iterations with EACH VERSION being a totally new program with "new features" that work in a way that it totally DIFFERENT than any other version. Personally it sounds like the company has, quite frankly, "lost it way" and is wandering between random ideas ffrom month to month. 

 

First there was Telechart, then there was blocks, then there was Stockfinder now there is TC2000 v? But mportanat features were left out of what is  now TC v? compareed to it's parent?

 

It would not surprise me the least of you have lost a lot of subscribers along the way! I'm wondering if this is going to continue because if it is, I may switch to a more stable program from another company. And I've been with you for 20 years. Someone high up needs to take control of the situation and grab the management bull by the horns. This is a ship with  no rudder right now. We want continued addition  of NEW features WITHOUT destruction of the old useful features that were the reason why we srated to use the darn program to begin with!

 

go4it

 

please forward to Chris & Peter.

Bruce_L
Posted : Monday, July 9, 2012 12:27:13 PM


Worden Trainer

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

A Moving Linear Regression indicator in TC2000 version 7 with the following settings:

- Period: 30
- Extension: 0
- Point to Plot: 30
- Width: 20

Could be reproduced in TC2000 version 12.2 using a Custom PCF Indicator wiith the following settings:

- Period: 1
- Average Type: Doesn't matter (because the Period is 1).
- Width Multiplier: 2.00
- Indicator Line Formula: AVGC30 - 15.5 * (14.5 * C + 13.5 * C1 + 12.5 * C2 + 11.5 * C3 + 10.5 * C4 + 9.5 * C5 + 8.5 * C6 + 7.5 * C7 + 6.5 * C8 + 5.5 * C9 + 4.5 * C10 + 3.5 * C11 + 2.5 * C12 + 1.5 * C13 + .5 * C14 - .5 * C15 - 1.5 * C16 - 2.5 * C17 - 3.5 * C18 - 4.5 * C19 - 5.5 * C20 - 6.5 * C21 - 7.5 * C22 - 8.5 * C23 - 9.5 * C24 - 10.5 * C25 - 11.5 * C26 - 12.5 * C27 - 13.5 * C28 - 14.5 * C29) / 2247.5
- Channel Width Formula: 10 * (ABS(C29 - AVGC2.29) + ABS(C28 - AVGC3.28) + ABS(C27 - AVGC4.27) + ABS(C26 - AVGC5.26) + ABS(C25 - AVGC6.25) + ABS(C24 - AVGC7.24) + ABS(C23 - AVGC8.23) + ABS(C22 - AVGC9.22) + ABS(C21 - AVGC10.21) + ABS(C20 - AVGC11.20) + ABS(C19 - AVGC12.19) + ABS(C18 - AVGC13.18) + ABS(C17 - AVGC14.17) + ABS(C16 - AVGC15.16) + ABS(C15 - AVGC16.15) + ABS(C14 - AVGC17.14) + ABS(C13 - AVGC18.13) + ABS(C12 - AVGC19.12) + ABS(C11 - AVGC20.11) + ABS(C10 - AVGC21.10) + ABS(C9 - AVGC22.9) + ABS(C8 - AVGC23.8) + ABS(C7 - AVGC24.7) + ABS(C6 - AVGC25.6) + ABS(C5 - AVGC26.5) + ABS(C4 - AVGC27.4) + ABS(C3 - AVGC28.3) + ABS(C2 - AVGC29.2) + ABS(C1 - AVGC30.1) + ABS(C - AVGC31)) / 620

The Point to Plot setting in TC2000 version 7 does not specify the number of bars being used in the calculations. In specifies the number of bars from the end of the Linear Regression Line you want to use as a sample when plotting the current value. So in the case of 30, you would be plotting the value 1-bar to the left of the start of standard Linear Regression Line.

I suspect you actually want to use a Point to Plot of 0 as that would plot the right end point of the Linear Regression Line. This would require changing one - 15.5 * into a + 14.5 instead (adding 30 to -15.5 results in 14.5):

- Period: 1
- Average Type: Doesn't matter (because the Period is 1).
- Width Multiplier: 2.00
- Indicator Line Formula: AVGC30 + 14.5 * (14.5 * C + 13.5 * C1 + 12.5 * C2 + 11.5 * C3 + 10.5 * C4 + 9.5 * C5 + 8.5 * C6 + 7.5 * C7 + 6.5 * C8 + 5.5 * C9 + 4.5 * C10 + 3.5 * C11 + 2.5 * C12 + 1.5 * C13 + .5 * C14 - .5 * C15 - 1.5 * C16 - 2.5 * C17 - 3.5 * C18 - 4.5 * C19 - 5.5 * C20 - 6.5 * C21 - 7.5 * C22 - 8.5 * C23 - 9.5 * C24 - 10.5 * C25 - 11.5 * C26 - 12.5 * C27 - 13.5 * C28 - 14.5 * C29) / 2247.5
- Channel Width Formula: 10 * (ABS(C29 - AVGC2.29) + ABS(C28 - AVGC3.28) + ABS(C27 - AVGC4.27) + ABS(C26 - AVGC5.26) + ABS(C25 - AVGC6.25) + ABS(C24 - AVGC7.24) + ABS(C23 - AVGC8.23) + ABS(C22 - AVGC9.22) + ABS(C21 - AVGC10.21) + ABS(C20 - AVGC11.20) + ABS(C19 - AVGC12.19) + ABS(C18 - AVGC13.18) + ABS(C17 - AVGC14.17) + ABS(C16 - AVGC15.16) + ABS(C15 - AVGC16.15) + ABS(C14 - AVGC17.14) + ABS(C13 - AVGC18.13) + ABS(C12 - AVGC19.12) + ABS(C11 - AVGC20.11) + ABS(C10 - AVGC21.10) + ABS(C9 - AVGC22.9) + ABS(C8 - AVGC23.8) + ABS(C7 - AVGC24.7) + ABS(C6 - AVGC25.6) + ABS(C5 - AVGC26.5) + ABS(C4 - AVGC27.4) + ABS(C3 - AVGC28.3) + ABS(C2 - AVGC29.2) + ABS(C1 - AVGC30.1) + ABS(C - AVGC31)) / 620

Note that TC2000 version 7 does not use Standard Deviation to calculate the width of its Linear Regression Channels.

Linear regression channel calculations

You would need to replace the Channel Width Formula with the following if you wanted to use Standard Deviation instead:

SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 + C22 ^ 2 + C23 ^ 2 + C24 ^ 2 + C25 ^ 2 + C26 ^ 2 + C27 ^ 2 + C28 ^ 2 + C29 ^ 2 - 30 * AVGC30 ^ 2) / 30)

In either case, you can adjust Width by adjusting the Width Multiplier. Use 3.00 or 4.00 to multiply the width by 3 or 4 instead of 2. You can set the Width Multiplier to 0.00 to get rid of the channels completely.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
go4it
Posted : Wednesday, July 18, 2012 11:07:51 PM
Registered User
Joined: 10/7/2004
Posts: 18

Bruce,

 

Thank you for these formulae for TC v12.

Bruce_L
Posted : Thursday, July 19, 2012 7:58:22 AM


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.