This indicator is a ranking tool used to compare a group of stocks, ETFs or futures contracts to determine which specific instrument is performing best. The indicator creates a score based upon the symbols historical price movement. You can then compare this score to the other RS Rank scores of other stocks or ETFs in your basket of trading instruments. Thus, you can simply pick the instrument with the highest RS Rank score when creating a momentum based trading system.
The RS Rank is computed by taking the average of a long-term price change with a short term price change. This average is then divided by the 10-day Average True Range. This will produce a ranking score which can be compared to other instruments.
//PRC_Relative Strength Rank | indicator
//08.07.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
RsrShortPeriod = 20
RsrLongPeriod = 140
RsrMaMode = 0 //MA type
AtrPeriod = 10
// --- end of settings
RsrPrice = customclose
price = average[1](RsrPrice)
mas = average[RsrShortPeriod,RsrMaMode](RsrPrice)
mal = average[RsrLongPeriod,RsrMaMode](RsrPrice)
atr = averagetruerange[AtrPeriod]
if (atr<>0) then
rsr = (price-mas+price-mal)/(2.0*atr)
else
rsr = 0
endif
slope = slope[1]
if (rsr>rsr[1]) then
slope = 1
endif
if (rsr<rsr[1]) then
slope = -1
endif
rsrhuu=0
if (rsr>0) then
if slope=1 then
rsrHuu = rsr
else
drawbarchart(0,rsr,0,0) coloured(0,191,255)
endif
endif
rsrhdd=0
if (rsr<0) then
if (slope=-1) then
rsrHdd = rsr
else
drawbarchart(0,0,rsr,0) coloured(199,21,133)
endif
endif
return rsrhuu coloured(0,191,255) style(histogram), rsrhdd coloured(199,21,133) style(histogram), rsr coloured(150,150,150) style(line,4)
You must be logged in to post a comment.
Hi Nicolas, as you suggested I made a screener out of your indicator and the results are really interesting. Couple of questions: -why you divided by 2*atr? -in your opinion could be interesting to add two more timeframes in the calculation? Like 3, 6,9 and 12 months. Thank you and have a nice day!
Hi Nicolas, I have been using pr real time extensively but just end of the day. I would appreciate some advice on automated system where system it buys on cross over of 8 and 20 and sell also accordingly. How to get started with that automated system? Can you suggested the possible steps? I have interactive broker account Thanks Vineet
is there a rs indictor that compare the stock to the spy?