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

3 line Linear Regression CHANNEL filter (not ONE Linear regression line) Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
karina234
Posted : Tuesday, October 29, 2013 4:51:05 PM
Registered User
Joined: 11/1/2007
Posts: 29

Is there a scan or filter that can be created telling TC2000 to find stocks (for example) with volume 2M+, price > 30,  where price has touched above or below either the upper or lower linear regression lines in the channel.  (assuming the Linear Regression channel has 3 lines - upper, middle, lower) . Touching Upper or lower channel lines are preferred.   Thanks.

 

Bruce_L
Posted : Tuesday, October 29, 2013 5:03:32 PM


Worden Trainer

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

Well yes, but only if the you specify how to calculate the width of the linear regression channel (as TC2000 version 12.3 does not have a linear regression based indicator with channels - although it does have a drawing tool).

The calculation of the channels in TC2000 version 7 is covered in the Linear regression channel calculations topic. Common methods used to calculate the widths of linear regression channels include standard deviation(see Modelling Bollinger Bands (& Standard Deviation) in a TC PCF), standard error (see Need help writing a PCF for r-squared) and average true range (see Please provide a description and PCF for calculating an ATR value to be used as a stop loss value). Numerous other methods could be used as well.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
vinmd73
Posted : Wednesday, March 12, 2014 12:37:50 AM
Registered User
Joined: 3/2/2014
Posts: 2

Another issue in this realm- I would like to sort stocks by the price distance away from the linear regression line (varying periods but usually 20), both above and below.  I can then use the drawing tool to add the channel width of my preference to visually inspect the stock price according to the channel.  Is there a formula for calculating the positive and negative difference of price from the linear regression line that can be added to a scan for sorting purposes? Can you recommend a formula to use? 

I want to recreate the previous function from earlier TC versions where one could sort their scan by divergence of price from the linear regression line using the linear regression channel "indicator" which no longer exists.

If this makes sense, let me know the best way to do so.  Thank you.

Bruce_L
Posted : Wednesday, March 12, 2014 12:16:58 PM


Worden Trainer

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

An Indicator Formula for how far price is currently above or below a 20-period linear regression line can be written as:

C - (AVGC20 + 9.5 * (9.5 * C + 8.5 * C1 + 7.5 * C2 + 6.5 * C3 + 5.5 * C4 + 4.5 * C5 + 3.5 * C6 + 2.5 * C7 + 1.5 * C8 + .5 * C9 - .5 * C10 - 1.5 * C11 - 2.5 * C12 - 3.5 * C13 - 4.5 * C14 - 5.5 * C15 - 6.5 * C16 - 7.5 * C17 - 8.5 * C18 - 9.5 * C19) / 665)

You could express this as a percentage using:

100 * (C / (AVGC20 + 9.5 * (9.5 * C + 8.5 * C1 + 7.5 * C2 + 6.5 * C3 + 5.5 * C4 + 4.5 * C5 + 3.5 * C6 + 2.5 * C7 + 1.5 * C8 + .5 * C9 - .5 * C10 - 1.5 * C11 - 2.5 * C12 - 3.5 * C13 - 4.5 * C14 - 5.5 * C15 - 6.5 * C16 - 7.5 * C17 - 8.5 * C18 - 9.5 * C19) / 665) - 1)

The Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis topic explores how to create linear regression related formulas.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stochastics
Posted : Friday, July 18, 2014 10:26:03 PM
Gold Customer Gold Customer

Joined: 3/3/2013
Posts: 57

Morning Bruce,

Assuming that I draw Horizontal Lines @ 75% & 25% w/ (% Distance from Lin Reg 125) PCF, how would I calculate these figures?  

Or Horizontal Lines @ 75% & 25% w/ (Price Distance from Lin Reg 125) PCF?   

100 * (C / (AVGC125 + 62 * (62 * C + 61 * C1 + 60 * C2 + 59 * C3 + 58 * C4 + 57 * C5 + 56 * C6 + 55 * C7 + 54 * C8 + 53 * C9 + 52 * C10 + 51 * C11 + 50 * C12 + 49 * C13 + 48 * C14 + 47 * C15 + 46 * C16 + 45 * C17 + 44 * C18 + 43 * C19 + 42 * C20 + 41 * C21 + 40 * C22 + 39 * C23 + 38 * C24 + 37 * C25 + 36 * C26 + 35 * C27 + 34 * C28 + 33 * C29 + 32 * C30 + 31 * C31 + 30 * C32 + 29 * C33 + 28 * C34 + 27 * C35 + 26 * C36 + 25 * C37 + 24 * C38 + 23 * C39 + 22 * C40 + 21 * C41 + 20 * C42 + 19 * C43 + 18 * C44 + 17 * C45 + 16 * C46 + 15 * C47 + 14 * C48 + 13 * C49 + 12 * C50 + 11 * C51 + 10 * C52 + 9 * C53 + 8 * C54 + 7 * C55 + 6 * C56 + 5 * C57 + 4 * C58 + 3 * C59 + 2 * C60 + C61 - C63 - 2 * C64 - 3 * C65 - 4 * C66 - 5 * C67 - 6 * C68 - 7 * C69 - 8 * C70 - 9 * C71 - 10 * C72 - 11 * C73 - 12 * C74 - 13 * C75 - 14 * C76 - 15 * C77 - 16 * C78 - 17 * C79 - 18 * C80 - 19 * C81 - 20 * C82 - 21 * C83 - 22 * C84 - 23 * C85 - 24 * C86 - 25 * C87 - 26 * C88 - 27 * C89 - 28 * C90 - 29 * C91 - 30 * C92 - 31 * C93 - 32 * C94 - 33 * C95 - 34 * C96 - 35 * C97 - 36 * C98 - 37 * C99 - 38 * C100 - 39 * C101 - 40 * C102 - 41 * C103 - 42 * C104 - 43 * C105 - 44 * C106 - 45 * C107 - 46 * C108 - 47 * C109 - 48 * C110 - 49 * C111 - 50 * C112 - 51 * C113 - 52 * C114 - 53 * C115 - 54 * C116 - 55 * C117 - 56 * C118 - 57 * C119 - 58 * C120 - 59 * C121 - 60 * C122 - 61 * C123 - 62 * C124) / 162750) - 1)
 
Bruce_L
Posted : Monday, July 21, 2014 12:03:04 PM


Worden Trainer

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

There really isn't a way to automatically draw horizontal lines in TC2000 based on the results of a formula.

I'm not sure what the 25% and 75% are supposed to be calculated from. Assuming you want the value that would return 25% in the PCF given in your post, you would get:

1.25 * (AVGC125 + 62 * (62 * C + 61 * C1 + 60 * C2 + 59 * C3 + 58 * C4 + 57 * C5 + 56 * C6 + 55 * C7 + 54 * C8 + 53 * C9 + 52 * C10 + 51 * C11 + 50 * C12 + 49 * C13 + 48 * C14 + 47 * C15 + 46 * C16 + 45 * C17 + 44 * C18 + 43 * C19 + 42 * C20 + 41 * C21 + 40 * C22 + 39 * C23 + 38 * C24 + 37 * C25 + 36 * C26 + 35 * C27 + 34 * C28 + 33 * C29 + 32 * C30 + 31 * C31 + 30 * C32 + 29 * C33 + 28 * C34 + 27 * C35 + 26 * C36 + 25 * C37 + 24 * C38 + 23 * C39 + 22 * C40 + 21 * C41 + 20 * C42 + 19 * C43 + 18 * C44 + 17 * C45 + 16 * C46 + 15 * C47 + 14 * C48 + 13 * C49 + 12 * C50 + 11 * C51 + 10 * C52 + 9 * C53 + 8 * C54 + 7 * C55 + 6 * C56 + 5 * C57 + 4 * C58 + 3 * C59 + 2 * C60 + C61 - C63 - 2 * C64 - 3 * C65 - 4 * C66 - 5 * C67 - 6 * C68 - 7 * C69 - 8 * C70 - 9 * C71 - 10 * C72 - 11 * C73 - 12 * C74 - 13 * C75 - 14 * C76 - 15 * C77 - 16 * C78 - 17 * C79 - 18 * C80 - 19 * C81 - 20 * C82 - 21 * C83 - 22 * C84 - 23 * C85 - 24 * C86 - 25 * C87 - 26 * C88 - 27 * C89 - 28 * C90 - 29 * C91 - 30 * C92 - 31 * C93 - 32 * C94 - 33 * C95 - 34 * C96 - 35 * C97 - 36 * C98 - 37 * C99 - 38 * C100 - 39 * C101 - 40 * C102 - 41 * C103 - 42 * C104 - 43 * C105 - 44 * C106 - 45 * C107 - 46 * C108 - 47 * C109 - 48 * C110 - 49 * C111 - 50 * C112 - 51 * C113 - 52 * C114 - 53 * C115 - 54 * C116 - 55 * C117 - 56 * C118 - 57 * C119 - 58 * C120 - 59 * C121 - 60 * C122 - 61 * C123 - 62 * C124) / 162750)

You would need to change the 1.25 to 1.75 to get the value that would cause the formula to return 75 instead of 25.



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