IBD Style Chart and Scan

B

Bamilus

New member
IBD RS rating doesn't include fundamentals, but their composite rating and other ratings do.
 
S

soary

Member
It was made as a watchlist column, not a scan code. So just put the code as is in one of the custom slots on your WL and it should show up, then you just sort the rank.
Yes, it added the column for rank but didn’t give me numbers instead it says, “Custom expression subscription limit exceeded.” I have only used 3 of my 19 custom slots so what does this mean? Also help, it seems that I need to customize the code because it says,


# Set length to period of interest.

# 1 Wk – 5 trading days


And since I want a week, I added these 2 lines. Did I do that right?

def week = if close-close[5] is less than 0 then 0 else close-close[5] ;

input length = 5 days;



and what do I enter for hi and lo?


def h = highest(high, 21);

def l = lowest(low, 21);

Shouldn’t hi and lo be a different number?
Thanks for your help.
 
R

RickAns

New member
@soary I think you are supposed to choose the 'Wk" from the pull down selection just to the right of where you type in the name for the custom column you just created. No need to edit or modify the body of the code itself. Just above the thinkScript Editor box that you select to be able to paste in the code.
 
S

soary

Member
@soary I think you are supposed to choose the 'Wk" from the pull down selection just to the right of where you type in the name for the custom column you just created. No need to edit or modify the body of the code itself. Just above the thinkScript Editor box that you select to be able to paste in the code.
Wonderful one of my 3 questions answered. Tthank you. Does it make sense that the hi/lo in the code is the same number of days or am I supposed to change it to something else and what that could be? It seems like they would cancel out if they are the same number of days.
[]]
p[\
 
R

RickAns

New member
Just to be certain I believe we are talking about wtf_dude's code. It does make sense that the hi / lo numbers are the same. The look back period is a year, then the quarters are ranked against each other. With more concern given to the most recent quarter.

I am still new to coding so it took me to read it a few times to make sense. It does, but I may not be the best one to explain it to someone else. This uses a one year time frame 252 trading days that's a given. What we are setting (I believe) with day / week / month is just a small window or snapshot of what the data ranking is for the current most recent day/ week/ etc. Try not to think of it as setting (for example) a time period of a moving average or whatever.

I can delete my example if completely wrong in order to avoid further confusion. :oops:


Added:
By changing the hi /lo to 21 in your example post instead of the original 252 you have told the code to look back only 21 days max instead of a year. Preventing you from getting the stock's high and low of the year. So you are only getting a ranking for the last month's worth of data.

Does this help?
 
Last edited:
wtf_dude

wtf_dude

Member
Yes, it added the column for rank but didn’t give me numbers instead it says, “Custom expression subscription limit exceeded.” I have only used 3 of my 19 custom slots so what does this mean? Also help, it seems that I need to customize the code because it says,


# Set length to period of interest.

# 1 Wk – 5 trading days


And since I want a week, I added these 2 lines. Did I do that right?

def week = if close-close[5] is less than 0 then 0 else close-close[5] ;

input length = 5 days;



and what do I enter for hi and lo?


def h = highest(high, 21);

def l = lowest(low, 21);

Shouldn’t hi and lo be a different number?
Thanks for your help.
Ok, first question: custom subscription exceeded means you have too many advanced calculations going on and TOS doesn't wanna do any more for ya basically haha. I really never looked into if its a RAM thing or if iits just because real money runs through different servers. SOMETIMES you'll get that message on the real money side and not on the paper money side. May want to check to see if it works over there first. If it does, it's a server thing most likely.

Next, I can't really tell what youre trying to do? Are you trying to just do like day and month?

Next question. The high and low expression, you just put the longest time frame you want to check. What that code does is find the all the time high within that many days, and the lowest low of that many days. You don't need to change anything but timeframe for the search
 
S

soary

Member
"Next question. The high and low expression, you just put the longest time frame you want to check. What that code does is find the all the time high within that many days, and the lowest low of that many days. You don't need to change anything but timeframe for the search:"

Ok, first question: custom subscription exceeded means you have too many advanced calculations going on and TOS doesn't wanna do any more for ya basically haha. I really never looked into if its a RAM thing or if iits just because real money runs through different servers. SOMETIMES you'll get that message on the real money side and not on the paper money side. May want to check to see if it works over there first. If it does, it's a server thing most likely.

Next, I can't really tell what youre trying to do? Are you trying to just do like day and month?

Next question. The high and low expression, you just put the longest time frame you want to check. What that code does is find the all the time high within that many days, and the lowest low of that many days. You don't need to change anything but timeframe for the search

wtf_dude aaaaha! I get it now. it makes sense why the numbers of days is the same. lol Thank you for your patience and answering my questions. I learned a lot with this thread. I'll find out from TOS what that msg is all about

RickAns thank you for your help, it was nice of you.
 
A

Art

New member
@wtf_dude question for you. When I add your script to my chart, my entire chart's background turns from dark to red. What am I doing wrong/missing? Thanks
 
wtf_dude

wtf_dude

Member
@wtf_dude question for you. When I add your script to my chart, my entire chart's background turns from dark to red. What am I doing wrong/missing? Thanks
It's not a code made for a chart, its made for a watchlist column for sorting. It's turning red because the code assigns a background color to each "box" on a watchlist based on value.
 
R

RickAns

New member
@Art I made that mistake too. Then I re-read the part about it being for the watchlist column and not the chart. :giggle:

I'm liking this code, thanks @wtf_dude .
 
S

sfs00784

New member
Relative Price Strength (RS) Rating or Relative Strength [official]
This IBD SmartSelect Corporate Rating is a measure of a stock’s price performance over the last twelve months, compared to all stocks in our database. A 40% weight is assigned to the latest three-month period; the remaining three quarters each receive 20% weight. The rating scale ranges from 1 (lowest) to 99 (highest). Initial Public Offering (IPO) stocks will be assigned a "1" rating until the data from five trading sessions are available for calculation.

The formula I saw is this for RS: [from a forum]
.4TR13weeks*.2TR26weeks*.2TR39weeks*.2TR52weeks
TR=total return.

Anyone can write a line to test it?
I am new to this.
 
Thread starter Similar threads Forum Replies Date
R Questions 13

Top