Updated 9-5-19: In this shared Google Drive are 2 files:
1) a file comparison of yesterdays IBD Relative Strength direct from IBD, along with a listing of what the watchlist code reads for the same security. If you follow the stocks in IBD's 85-85 list, my hope is that you would find most of them ranked above 70 in the watchlist column.
2) the picture is of the watchlist code on the right on my screen shot of the same NASDAQ 100.
Here's the Code to put in a Custom Column:
#uTS Watchlist Code for %52WkRng #Mobius© WLC Percent Inside 52 Week Range def h = highest(high, 252); def l = lowest(low, 252); def x = (close - l) / (h - l); plot r = round(x * 100, 0); #4 lines is complete code#
Below is a scan that I came across that will pull the top 20% of Relative Strength stocks in a Scan of the S&P 500. After loading the scanned list, most were above the 75% line for the above chart's RS line. I also changed the inputs to 0 & 20 and the RS line on this chart was down on all on the list. I suggest scanning in S&P 100 or 500 to keep your list manageable. My thanks to Chris Baker.
# Scan - Price Rank in Range 80-100 # Edited by Markos to prove out scan for Relative Strength - Use is set for 1Yr-1Day Chart # This Scan Tab study finds stocks whose price is in the given Price Rank (Price Percentile) # in the given number of bars. # By Chris Baker <[email protected]> @ChrisBaker97 # Latest version maintained at: https://bitbucket.org/ChrisBaker97/thinkscript/src/ # This thinkScript is designed for use in the Scan tab. Detailed # instructions may be found at: https://bitbucket.org/ChrisBaker97/thinkscript/ # # This work is licensed under the Creative Commons Attribution-ShareAlike # 3.0 Unported License. To view a copy of this license, visit: # http://creativecommons.org/licenses/by-sa/3.0/deed.en_US #Start Code input period = 252; input prLo = 80; input prHi = 100; def hi = highest(high,period); def lo = lowest(low,period); def range = hi - lo; def priceRank = 100 * (open - lo) / range; plot inRange = prLo <= priceRank and priceRank <= prHi; #End Code