Linear Regression Divergence Scanner

caspara2

New member
VIP
Hello! I am in search of a way to scan for stocks in ThinkorSwim that look similar to AEO or DAC on the 1Y:1D chart, with predictable upward movement of price in a nearly straight line over a six months or a year timeframe. The key here is that I do not want stocks that have huge and risky one-day price changes.

In my search online, I did find this site that has their own scan technology and methodology. It apparently uses Linear Regression Divergence min and max defined values to perform the scan. I am just needing something similar using ThinkorSwim's stock scanner, although it does not have to use Linear Regression.

My plan is to combine the above needed study with an existing scan that I use that simply uses six copies of the Price Change study using equally increasing (linear) ratios of percentage change and number of bars going back to around a year. I get very strong, mostly linear trending stocks using this scan, but figured there must be a way to limit the results to consistent and friendlier "straight-line" upward price movement stocks.

Can anyone help?
 
Last edited:

germanburrito

Active member
Hello! I am in search of a way to scan for stocks in ThinkorSwim that look similar to BXC on the 1Y:1D chart, with predictable upward movement of price in a nearly straight line over a six months or a year timeframe. The key here is that I do not want stocks that have huge and risky one-day price changes.

In my search online, I did find this site that has their own scan technology and methodology. It apparently uses Linear Regression Divergence min and max defined values to perform the scan. I am just needing something similar using ThinkorSwim's stock scanner, although it does not have to use Linear Regression.

My plan is to combine the above needed study with an existing scan that I use that simply uses six copies of the Price Change study using equally increasing (linear) ratios of percentage change and number of bars going back to around a year. I get very strong, mostly linear trending stocks using the latter study, but figured there must be a way to limit the results to consistent and friendlier "straight-line" upward price movement stocks.

Can anyone help?
this is just an idea. idk. you might want to use rsquare. what rsquare evaluates is how close price is to the trend or how close its following it. so anything over .6 means that its more predictable. so what you can do is set rsquare to maybe 120( 6 months x 20 days) and scan for stocks over .6 rsquare, or even higher.
 

caspara2

New member
VIP
this is just an idea. idk. you might want to use rsquare. what rsquare evaluates is how close price is to the trend or how close its following it. so anything over .6 means that its more predictable. so what you can do is set rsquare to maybe 120( 6 months x 20 days) and scan for stocks over .6 rsquare, or even higher.
@germanburrito, that did seem to help. Apparently my existing scan was producing fairly linear results anyway, but when I added the rsquare study with a value of 0.935 over the entire period (approximately half a year), it refined the results further. Many thanks!

The results when using this in combination with my previous scan studies are an average of 0.6-1.5% positive change in average prices per day of the stocks in the scan results over the one-half year time frame, all with a much lesser chance of any stock dropping (bleeding) 5 or more percent in a day within that time frame. Excellent!
 
Last edited:

germanburrito

Active member
@germanburrito, that did seem to help. Apparently my existing scan was producing fairly linear results anyway, but when I added the rsquare study with a value of 0.935 over the entire period (approximately half a year), it refined the results further. Many thanks!

The results when using this in combination with my previous scan studies are an average of 0.6-1.5% positive change in average prices per day of the stocks in the scan results over the one-half year time frame, all with a much lesser chance of any stock dropping 5 or more percent in a day within that time frame. Excellent!
thats awesome man!!! what else do you use to scan?
 

caspara2

New member
VIP
Sure! I am a firm believer that your scan is the most important part of any trading strategy. The scans don't lie, but our emotions do! Patience and compounding average daily percentage gains always win in the end.

These TOS scan settings (ALL set to Wk aggregation):
Stock: Volume min 50,000 (5,000 if scanning premarket) to max unlimited
Stock: Last min 1 to max 500
Study: Price_Change CLOSE is at least 80 % greater than 32 bars ago
Study: Price_Change CLOSE is at least 40 % greater than 16 bars ago
Study: Price_Change CLOSE is at least 20 % greater than 8 bars ago
Study: Price_Change CLOSE is at least 10 % greater than 4 bars ago
Study: Price_Change CLOSE is at least 2.5 % greater than 1 bars ago
Study: Custom... RSquared() is greater than or equal to 0.935 within 32 bars

I had read about r-squared on a couple math websites and YouTube videos the past couple days, but didn't think to look to see if TOS had this study. Thanks again for the recommendation. It seems to be a good tool to have in the toolbelt.
 
Last edited:

germanburrito

Active member
Sure! I am a firm believer that your scan is the most important part of any trading strategy. The scans don't lie, but our emotions do! Patience and compounding average daily percentage gains always win in the end.

These TOS scan settings (ALL set to Wk aggregation):
Stock: Volume min 50,000 (5,000 if scanning premarket) to max unlimited
Stock: Last min 1 to max 500
Study: Price_Change CLOSE is at least 80 % greater than 32 bars ago
Study: Price_Change CLOSE is at least 40 % greater than 16 bars ago
Study: Price_Change CLOSE is at least 20 % greater than 8 bars ago
Study: Price_Change CLOSE is at least 10 % greater than 4 bars ago
Study: Price_Change CLOSE is at least 2.5 % greater than 1 bars ago
Study: Custom... RSquared() is greater than or equal to 0.935 within 32 bars

I had read about r-squared on a couple math websites and YouTube videos the past couple days, but didn't think to look to see if TOS had this study. Thanks again for the recommendation. It seems to be a good tool to have in the toolbelt.
thank you, i believe its fairly importan in statistics, i sorta use it in my trading sttrategy.
 

germanburrito

Active member
Sure! I am a firm believer that your scan is the most important part of any trading strategy. The scans don't lie, but our emotions do! Patience and compounding average daily percentage gains always win in the end.

These TOS scan settings (ALL set to Wk aggregation):
Stock: Volume min 50,000 (5,000 if scanning premarket) to max unlimited
Stock: Last min 1 to max 500
Study: Price_Change CLOSE is at least 80 % greater than 32 bars ago
Study: Price_Change CLOSE is at least 40 % greater than 16 bars ago
Study: Price_Change CLOSE is at least 20 % greater than 8 bars ago
Study: Price_Change CLOSE is at least 10 % greater than 4 bars ago
Study: Price_Change CLOSE is at least 2.5 % greater than 1 bars ago
Study: Custom... RSquared() is greater than or equal to 0.935 within 32 bars

I had read about r-squared on a couple math websites and YouTube videos the past couple days, but didn't think to look to see if TOS had this study. Thanks again for the recommendation. It seems to be a good tool to have in the toolbelt.
@germanburrito, that did seem to help. Apparently my existing scan was producing fairly linear results anyway, but when I added the rsquare study with a value of 0.935 over the entire period (approximately half a year), it refined the results further. Many thanks!

The results when using this in combination with my previous scan studies are an average of 0.6-1.5% positive change in average prices per day of the stocks in the scan results over the one-half year time frame, all with a much lesser chance of any stock dropping (bleeding) 5 or more percent in a day within that time frame. Excellent!
https://medium.com/geekculture/usin...ading-signals-a-python-back-test-bfa57222c936
 

Similar threads

Top