Custom Scan Using a Corrected Relative Strength Study
Quickly find stocks that over-perform or under-perform an index. This video shows how to configure a custom scan in Thinkorswim using an improved Relative Strength study. Use recent market turning points as your start date. The scan will compare stock performance from that date forward. Easily find stocks that are trending stronger or weaker than the index. Catch stocks as they make their first transition from under-perform to over-perform. Find out where the big money is reallocating their holdings.
Markets go through cycles, and during transitions the old leaders are replaced by new ones. This scan will help you spot those stocks which are in the process of that transition. Free custom code is included. The clickable link is embedded directly in the video. Be sure to not to miss it.
Link to study file: Scan_RelativeStrengthSTUDY.ts
Lean More:
Would you like to learn how to master the custom scan tools on Thinkorswim?
Click here: Thinkorswim Scans Beginner to Advanced
Learn how to build custom scans without writing any code: Thinkorswim Condition Wizard
DISCLAIMER: I AM NOT A CERTIFIED FINANCIAL ADVISOR AND NOTHING IN THIS VIDEO OR TEXT IS AN ADVERTISEMENT OR RECOMMENDATION TO BUY OR SELL ANY FINANCIAL INSTRUMENT. NOR IS THIS VIDEO OR TEXT INTENDED TO INSTRUCT YOU ON HOW TO MAKE BUY OR SELL DECISIONS USING ANY OF THESE INDICATORS.
*Thinkorswim is a chart analysis platform offered by TD Ameritrade: www.tdameritrade.com
TD Ameritrade provides financial services including the trading of Stocks, Futures, Options and Forex.
Please be sure to share this page with your friends and colleagues. Leaving comments below is the best way to help make the content of this site even better.
Here is the code used to create your own custom watchlist columns as demonstrated in the video below.
Hi. Thank you so much for the detailed explanation and work you have done. Would it be possible to modify this so that it is even more useful? This seams to rely more on correlation than proportional strength (e.g. It is fine to identify stocks going up when SPY is going down, but if SPY is flat and the stock is going up, will it find it?).
Essentially I want something that will look at the percent change in Stock A and compare it to
the percent change in SPY over the same time period – however, that change has to be
proportional to the stock’s price and its average true range as well. Volume should be included in
this attribute so you don’t get stocks that made a big move off very little volume showing up.
Am I hoping for too much? I know I wouldn’t be able to code this but I thought you could possibly pull it off. Thank for everything you do!
What you have described sounds feasible. However it is much more complex than something I am interested in building for a free tutorial video.
That totally makes sense. Thank you!
Hi Pete. Thanks for the work on the Relative Strength Scan. Unfortunately after watching the video twice, I can’t seem to get the “OK” button in my Scan to become clickable. It stays grayed out no matter what I attempt to do. Screenshot here: https://www.screencast.com/t/kR1rwIlSg. I’ve downloaded the file, checked the start dates, and copied the code from the ScanRelativeStrength Study into the Scan. Let me know if there’s any hope for me. Thanks!
I can confirm that you have missed some of the steps which I explain in the video. When you paste the code into the study filter of the scan there are lines of code which must be modified. All of that is explained in the video, step-by-step.
I finally got it, thanks!
Its like pulling-teeth for days before I get it. Mucho Thanks for this world-class knowledge!
Thanks for taking the time to provide your feedback. I’m glad you found this video helpful!
Did Not Work, error in Thinkscript editor
Not much detail to work with. I suggest you go back and view the video. If the code is giving you errors that means you missed the steps that show which lines of code must be modified in order to use this as a scan.
I have recently watched the TOS Relative Strength Scan video and thought it would be extremely useful. I have uploaded the study but whenever I try to run the scans it says no stocks found. Same message with all 4 of the scans. Checked the code and I believe it is correct. Is there a fix that I can do.
Thanks so much.
Check that you are using the daily time frame and that you have correctly set the comparison start date to a day the markets were open for regular trade.
Thanks for your prompt reply. Chart is set on the Daily timeframe and the date is set to 1 July 2021 [20210701].
Appreciate your help.
I set up the scan using your start date and it’s working without any issues. I noticed you said the “chart” is set to daily time frame. But the chart has zero affect on the settings used for the scan. So the Study Filter needs to be set to daily time frame and when you paste the code into the Study Filter you must set the date for the user input named “referenceDate”.
Pete: thanks for your help. I have it working.
For some reason, I get an error code about “wrong timestamp for ETH/USD:CXERX on March 13 2021: 23:00” when I try and run the scan. I attached an imagur link that shows the error code and the scan code.
https://imgur.com/a/E3scpnM
The screenshot does not help in this case. This error message has been reported by some viewers on our YouTube channel. It does not happen for all users of Thinkorswim and the issue only started recently. Your screenshot does not show which top level filters you have applied to the scan (that was the most important detail you should have included in your screenshot). I suggest you apply some top level filters that are appropriate for this scan. For instance if you are using the ticker symbol “SPX” for the user input named “CorrelationWithSecurity”, your top level filter should be the stocks of the S&P 500 index. Since your error message contains a Forex currency pair I can only suggest that you have failed to setup the appropriate top level filters for your scan. If this does not resolve the issue you will need to contact support at TD Ameritrade because the problem is likely something that needs to be corrected on their servers.
Thank you so much! I was able to succesfully correct it by scanning through the s&p500 filter.
Excellent. Glad that helped and thanks for taking the time to let us know this solved the issue.