Relative Strength Rank Screener

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #111126 quote
    FabiusMor
    Participant
    Junior

    Good evening everyone,

    i’m testing a strategy based on the sector rotation, so i’ve put together a watchlist with several sector ETFs from the S&P500. The strategy consists in trading just the top 3 ETFs ranked by the strength of their trend.

    How to measure the strenght of the trend? I’ve read many articles and someone made an expression to calculate it.

     

    This is the expression:

    TrendStrength=(2*close/close(63))+(close/close(126))+(close/close(189))+(close/close(252))

    where close(63) is the closing price of 63 days ago and so on.

     

    The screener should rank the titles in the watchlist by this value.

    Can someone help me with this?

    Also, any other ideas on this topic or other ways to calculate this value are well accepted.

     

    Thank you and have a nice evening.

     

    F

    #111153 quote
    Nicolas
    Keymaster
    Master

    You can use the Relative Strength Rank Indicator in order to make the screener.

    #111168 quote
    FabiusMor
    Participant
    Junior

    Good morning Nicolas, thanks for the feedback.

    Well I saw that post before but first I don’t really know how to make a screener out of that code (my bad, I have to learn) and second it doesn’t really look like the one I described above. Isn’t it?

    #111169 quote
    Nicolas
    Keymaster
    Master

    Not the same as your formula indeed, so according to it you could try the simple screener below:

    TrendStrength=(2*close/close(63))+(close/close(126))+(close/close(189))+(close/close(252))
    
    screener(TrendStrength)

    All the shares of the list(s) will be automatically sorted with the “trendstrength” calculation result.

    FabiusMor thanked this post
    #111190 quote
    FabiusMor
    Participant
    Junior

    Thank you Nicolas, i didn’t know it was that easy.

    I’ll try to make also the screener based on the indicator you mentioned above.

     

    Have a nice day!

     

    F

    #111196 quote
    FabiusMor
    Participant
    Junior

    Sorry to bother you again, but the code gives me an error, please see attached picture for reference.

    Thank you

    error.png error.png
    #111199 quote
    Nicolas
    Keymaster
    Master

    Sorry, my mistake, Close offset should be in brackets, not parenthesis 🙂

    TrendStrength=(2*close/close[63])+(close/close[126])+(close/close[189])+(close/close[252])
    
    screener(TrendStrength)

     

    FabiusMor thanked this post
    #111239 quote
    FabiusMor
    Participant
    Junior

    Thanks a lot, now it works!

    #111722 quote
    FabiusMor
    Participant
    Junior

    You can use the Relative Strength Rank Indicator in order to make the screener.

    Good evening Nicolas,
    i’ve followed your advice and used your Relative Strength Rank Indicator to make a screener. I’m using it to rank a group of sector ETFs in order to trade the top three.

    I’ve read somewhere that some traders are using a similar indicator with more than two timeframes, so i modified the code as follows:

    //PRC_Relative Strength Rank | indicator
    //08.07.2019
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    RsrShortPeriod = 63
    RsrMedShort = 126
    RsrMedLong = 189
    RsrLongPeriod  = 252
    RsrMaMode      = 0 //MA type
    AtrPeriod      = 10
    // --- end of settings
    
    RsrPrice       = customclose
    
    price = average[1](RsrPrice)
    mas   = average[RsrShortPeriod,RsrMaMode](RsrPrice)
    mams = average[RsrMedShort,RsrMaMode](RsrPrice)
    maml = average[RsrMedLong,RsrMaMode](RsrPrice)
    mal   = average[RsrLongPeriod,RsrMaMode](RsrPrice)
    atr   = averagetruerange[AtrPeriod]
    if (atr<>0) then
    rsr = (price-mas+price-mams+price-maml+price-mal)/(2.0*atr)
    else
    rsr = 0
    endif
    
    screener (rsr)

    In your opinion, does it make any sense to involve two more timeframes in the calculation? 

    Considering such long timeframes, the value of ATR (now set at 10) should be increased?

     

    Thank you for your time and help.

    #111724 quote
    Bos.
    Participant
    Veteran

    Here is a version I made that’s slightly different. It screens for stocks with relative strength above 80% that are also above the 200ma

     

    indicator1 = Average[200](close)
    c4 = (close > indicator1)
    RS = 2*close/close[63] + close/close[126] + close/close[189] + close/close[252]
    Var1 = 8
    
    RelativeStrength = RS > Var1 AND c4
    
    SCREENER[RelativeStrength] (RelativeStrength AS "RS > 80%")
    Nicolas and FabiusMor thanked this post
    #111742 quote
    FabiusMor
    Participant
    Junior

    Thank you for your contribution Bos. Interesting point of view!

    I’ll be really glad to hear Nicolas’ opinion on the code i posted above 🙂

    #111743 quote
    Nicolas
    Keymaster
    Master

    What you have done is not a multiple timeframe analysis, but a single one with longest period. What you read about comparing multiple relative strength rank across multiple timeframes could be assimilated as a dual/triple momentum ranking.

    For instance, a dual momentum analysis is built upon the fact that a stock in a strong uptrend period (high strength) should have some small periods of calm (low strength) and that’s when you should consider invest in them, you can use this technique when re-balancing a portfolio.

    FabiusMor and Bos. thanked this post
    #111745 quote
    FabiusMor
    Participant
    Junior

    Thank you very much. I’ll discard the code i wrote then.

    Any advice on how to code a double/triple momentum screener? i’ve searched the forum but got nothing about it.

    #111762 quote
    FabiusMor
    Participant
    Junior

    Or it’s better to just use the screener i made out of with your RSR Indicator?

    #111792 quote
    Nicolas
    Keymaster
    Master

    Yes but with conditions based on 2 timeframe for instance. Use the TIMEFRAME instruction for ProScreener in order to achieve the dual momentum conditions.

    FabiusMor thanked this post
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.

Relative Strength Rank Screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
FabiusMor @fabiusmor Participant
Summary

This topic contains 16 replies,
has 1 voice, and was last updated by qizhong
4 years, 10 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 10/24/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...