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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
//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) |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
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
Please ask questions on forums. Not the place here and not related to that post:)
Good afternoon Nicolas,
in your opinion, this indicator is somehow similar to the one described in this (http://www.marketgauge.com/LeadershipReport.pdf) document in the first half of page 7?
Thank you and have a nice day.
F
Yes this is the same as described in this document.
Thank you Nicolas. As I said in the other post I don’t know how to make a screener out of it yet. I’ll take a look to the documentation. Thanks a lot!
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!
Could you share the screener you have created?
Hi Nicolas, could you help me to set up the screener for this. Thank you !!
Sure, please open a new topic in the screener forum and respect the posting rules.
HI Nicolas,
I know I’m bit late to use this somehow feel to give it a go. I cut and paste then I’ve got an error in line 38 “The keyword drawbarchart is only used for indicator programming (Probuilder) and also line 40 “endif”.
any help please
I think that you are trying to put an indicator code into a strategy or a screener code. Open the indicator creation code editor and everything will run fine.
is there a rs indictor that compare the stock to the spy?