IBD Style Chart and Scan

markos

markos

Well-known member
VIP
Warehouse



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.

https://drive.google.com/drive/folders/13XOHAGuDNjx6k98U5VB8AL2TmQOjyQqS?usp=sharing

Here's the Code to put in a Custom Column:
Code:
#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#
Use whichever you would like! :)

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.

Code:
# 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
 
Last edited:
dougn

dougn

New member
VIP
I always wondered how the IBD RS was created.

I plugged it into a watchlist column though the readings don't make sense.

Would it be adaptable to a watchlist column and or scan?

Thanks
 
markos

markos

Well-known member
VIP
Warehouse
It should be. You'd have to create it in the scan tab first, I think, but maybe can be done as a custom in the watch list. ( Working with an old tired memory here).
Please share and post what you find out. Thanks!
One tweak I made was changing the volume average line from 50 to 34 (now 21 as of 9-2-19) ... just because. :)
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
I always wondered how the IBD RS was created.
I plugged it into a watchlist column though the readings don't make sense.
Would it be adaptable to a watchlist column and or scan?
Thanks
@dougn I worked with it for a while last night to no avail. Stay tuned, I am working on getting this into a watchlist but it will take some time.
 
dougn

dougn

New member
VIP
Thanks markos. I am really enjoying the threads here and the info that is shared. Hopefully I can contribute something soon.
 
dougn

dougn

New member
VIP
Thank you for the effort markos.

I am jealous of my Twitter pals who subscribe to IBD and use this Relative Strength that is "proprietary". But I'm unwilling to pay 185. per month for Marketsmith. I've got years invested in Thinkorswim and there's no way I'm leaving or adding another chart system to the work load.

Hopefully someone will accept the challenge on this.
 
markos

markos

Well-known member
VIP
Warehouse
Post edited - Please review the 1st post.
@dougn I have found a scan, though not perfect, will get you the type of Relative Strength stock you and I would be looking for.
The reason the numbers look strange per the 2nd post is because it is close/close("SPY"). Ticker AZO is a 4.xx rank because it is 4x larger in price than SPY. The line is still valid, it just can't be scanned for or placed in a WLC thus the other scan was added to the 1st post. :)
 
markos

markos

Well-known member
VIP
Warehouse
@BenTen It would be a great project for our coders here to give us all the ability to put something close to IBD's Relative Strength in a Watch List Column (WLC) and Sort for it.
It's not as easy as one would think. Here's the post for the challenge: https://usethinkscript.com/threads/ibd-style-chart-and-scan.532/#post-4242
The scan that I posted comes close but I haven't found a way to put the ranking in a list.
@skynetgen @korygill @mc01439 @horserider and anyone else I missed.
 
mc01439

mc01439

Active member
VIP
Warehouse
@BenTen It would be a great project for our coders here to give us all the ability to put something close to IBD's Relative Strength in a Watch List Column (WLC) and Sort for it.
It's not as easy as one would think. Here's the post for the challenge: https://usethinkscript.com/threads/ibd-style-chart-and-scan.532/#post-4242
The scan that I posted comes close but I haven't found a way to put the ranking in a list.
@skynetgen @korygill @mc01439 @horserider and anyone else I missed.
Sorry markos - I tried but to date have not been able to match IBD RS for a Watch List Column .
 
dougn

dougn

New member
VIP
skynetgen ... can you please post the script? My customs are all filled and the only way I can install and check this out is with script. Thank you!
 
S

skynetgen

Active member
Warehouse
skynetgen ... can you please post the script? My customs are all filled and the only way I can install and check this out is with script. Thank you!
Well even though "custom quotes" appears limited you can import unlimited amount (or at least many more than 16). just click the link and it will add it to custom quotes beyond what is already there
 
dougn

dougn

New member
VIP
The rules change at 100. After that you have to share an existing column, install it with a new name, then paste in your desired script. Per TOS there is no way to delete custom columns once the slot is used so over 100 you will have to do it this way.
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
Here is watchlist quote
@skynetgen, back to the drawing board with ya! 🧐 All you did was colored the higher RS stocks Green & lower, Red.
Appreciate it, but you're a better coder than that. Right? :)
A number of us are looking for something akin to IBD's Rank for any given list of 1-99 with 99 being the highest Relative Strength.
Care to try again or are you stumped as well?
 
markos

markos

Well-known member
VIP
Warehouse
I have found a good proxy to get IBD's relative strength figured out. It will take a bit before it's ready for release and a shakedown for stability. Stay tuned. :cool:
 
S

skynetgen

Active member
Warehouse
@skynetgen, back to the drawing board with ya! 🧐 All you did was colored the higher RS stocks Green & lower, Red.
Appreciate it, but you're a better coder than that. Right? :)
A number of us are looking for something akin to IBD's Rank for any given list of 1-99 with 99 being the highest Relative Strength.
Care to try again or are you stumped as well?
You are right. I just threw in some quick code in 5 min. Upon further examination this project is much more involved:
1) close/close(index) need to be reworked as percentage to be normalized. as it is is now its pretty meaningless for ranking purposes
2) There relative rank is pretty hard to do since TOS does not support arrays/data sources. A quick proxy would probably be to get 3-10 comparison
(say with strongest sector (e.g. XLU) mid sector (XLI) and weakest sector (XLE)). That is another can of worms
 
markos

markos

Well-known member
VIP
Warehouse
At long last, it's the updated IBD Relative Strength Proxy. Please review the updated Thread Start at the top of the page!

IBD Chart, Scan Proxy Code, and Watchlist Proxy Code are at the top. @BenTen @skynetgen @mc01439 @dougn
 
Last edited by a moderator:
H

horserider

Well-known member
VIP
Warehouse
@markos Congratulations on a great project. Going to be checking this over the weekend for sure.
 
mc01439

mc01439

Active member
VIP
Warehouse



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.

https://drive.google.com/drive/folders/13XOHAGuDNjx6k98U5VB8AL2TmQOjyQqS?usp=sharing

Here's the Code to put in a Custom Column:
Code:
#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#
Use whichever you would like! :)

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.

Code:
# 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
@markos

Works very nice! Thanks for the research and posting. Below is the S&P 100 scan from this morning.

Watchlist Scanner
Results
SymbolDescriptionPrice Rank ScanP/C RatioLastNet Chng%ChangeVolumeMarket Cap5M_perfEarningsDiv. Yield - Current
DISWALT DISNEY COMPANY (THE) COM
82​
0.258​
138.84​
0​
0.00%
191​
250,103 M
20.77​
Earnings in 30 days
1.2317​
ALLALLSTATE CORP COM
85​
0.641​
104.38​
0​
0.00%
0​
34,361 M
10.02​
Earnings in 30 days
1.8881​
HONHONEYWELL INTERNATIONAL INC COM
85​
0.083​
170.37​
0​
0.00%
270​
122,583 M
5.13​
Earnings in 30 days
1.8357​
AIGAMER INTL GRP INC COM
86​
0.21​
54.68​
0​
0.00%
0​
47,567 M
21.86​
Earnings in 30 days
2.4024​
KMIKINDER MORGAN INC COM
86​
0.887​
20.51​
0​
0.00%
0​
46,431 M
2.86​
Earnings in 29 days
4.3103​
ABTABBOTT LABORATORIES COM
88​
0.646​
85.9​
0​
0.00%
222​
151,819 M
9.4​
Earnings in 29 days
1.4744​
LOWLOWE'S COMPANIES INC COM
88​
0.722​
114.21​
0​
0.00%
0​
88,147 M
-1.36​
Earnings in 30 days
2.0054​
CLCOLGATE-PALMOLIVE CO COM
89​
1.061​
74.29​
0​
0.00%
0​
63,741 M
9.22​
Earnings in 30 days
2.358​
UPSUNITED PARCEL SERVICE INC COM CL B
89​
0.906​
121.2​
0​
0.00%
0​
104,075 M
6.34​
Earnings in 30 days
3.6216​
NEENEXTERA ENERGY INC COM
90​
0.551​
219.81​
0​
0.00%
15​
107,432 M
16.52​
Earnings in 30 days
2.304​
AMGNAMGEN INC COM
91​
1.684​
207.65​
0​
0.00%
115​
124,528 M
6.55​
Earnings in 30 days
3.0063​
PEPPEPSICO INC COM
91​
1.176​
135.98​
0​
0.00%
426​
190,123 M
11.46​
Earnings in 20 days
2.8159​
SBUXSTARBUCKS CORP COM
91​
0.74​
95.56​
0​
0.00%
156​
114,385 M
27.07​
Earnings in 30 days
1.7178​
TXNTEXAS INSTRUMENTS INC COM
92​
0.421​
126.81​
0​
0.00%
0​
118,392 M
10.06​
Earnings in 30 days
2.5532​
WMTWALMART INC COM
92​
0.905​
115.44​
0​
0.00%
190​
329,549 M
16.34​
Earnings in 30 days
1.8663​
KOCOCA-COLA CO COM
93​
1.95​
55.12​
0​
0.00%
1350​
235,695 M
18.41​
Earnings in 30 days
3.1029​
MDTMEDTRONIC PLC COM
93​
0.292​
107.72​
0​
0.00%
30​
144,525 M
21.05​
Earnings in 30 days
1.9893​
NKENIKE INC COM CL B
93​
0.563​
88.42​
0​
0.00%
1736​
138,544 M
4.36​
Earnings in 13 days
1.1149​
BKNGBOOKING HOLDINGS INC COM
94​
0.928​
1994.44​
0​
0.00%
0​
84,787 M
11.5​
Earnings in 30 days
0​
MRKMERCK & CO INC COM
94​
0.679​
86.1​
0​
0.00%
25​
220,448 M
6.36​
Earnings in 30 days
2.5403​
SOSOUTHERN CO. COM
94​
0.776​
59.5​
0​
0.00%
0​
62,191 M
15.51​
Earnings in 30 days
4.3777​
DHRDANAHER CORP COM
95​
6.342​
142.95​
0​
0.00%
0​
102,548 M
8.34​
Earnings in 30 days
0.4618​
DUKDUKE ENERGY CORP COM
95​
1.106​
93.41​
0​
0.00%
0​
68,059 M
3.66​
Earnings in 30 days
4.2044​
LMTLOCKHEED MARTIN CORP COM
95​
0.449​
385.15​
0​
0.00%
120​
108,765 M
26.01​
Earnings in 30 days
2.3656​
CELGCELGENE CORP COM
96​
1.351​
97.51​
0​
0.00%
190​
69,109 M
2.64​
Earnings in 30 days
0​
CHTRCHARTER COMMUNICATIONS INC COM CL A
96​
1.092​
422.05​
0​
0.00%
0​
93,475 M
19.18​
Earnings in 30 days
0​
MCDMCDONALD'S CORPORATION COM
96​
0.649​
219.49​
0​
0.00%
111​
166,690 M
15.61​
Earnings in 30 days
2.1622​
COSTCOSTCO WHOLESALE CORP COM
97​
1.409​
296.97​
0​
0.00%
1244​
130,604 M
20.46​
Earnings in 20 days
0.95539​
MDLZMONDELEZ INTL INC COM CL A
97​
0.571​
56.14​
0​
0.00%
0​
80,962 M
13.16​
Earnings in 30 days
1.9295​
MSFTMICROSOFT CORP COM
97​
0.634​
140.05​
0​
0.00%
14886​
1,069,339 M
16.78​
Earnings in 30 days
1.3735​
ACNACCENTURE PLC COM
98​
1.432​
199.49​
0​
0.00%
0​
127,230 M
11.5​
Earnings in 15 days
1.5668​
HDHOME DEPOT INC COM
98​
0.898​
228.15​
0​
0.00%
1260​
249,859 M
12.09​
Earnings in 30 days
2.2531​
TGTTARGET CORP COM
98​
0.72​
108.54​
0​
0.00%
236​
55,456 M
32.48​
Earnings in 30 days
3.1403​
CMCSACOMCAST CORP COM CL A
99​
0.135​
46.41​
0​
0.00%
20​
210,933 M
14​
Earnings in 30 days
1.8922​
MAMASTERCARD INCORPORATED COM CL A
99​
0.694​
292.08​
0​
0.00%
4293​
296,333 M
23.62​
Earnings in 30 days
0.46876​
PGPROCTER & GAMBLE CO COM
99​
1.273​
122.76​
0​
0.00%
311​
307,223 M
16.95​
Earnings in 30 days
2.6425​
TAT&T INC COM
99​
0.667​
35.89​
0​
0.00%
4476​
262,248 M
10.81​
Earnings in 30 days
6.0579​
VVISA INC COM CL A
99​
0.841​
184.73​
0​
0.00%
914​
413,870 M
17.1​
Earnings in 30 days
0.55315​
 
Thread starter Similar threads Forum Replies Date
R Questions 5

Top