Rolling Return indicator

Forums ProRealTime English forum ProBuilder support Rolling Return indicator

  • This topic has 2 replies, 2 voices, and was last updated 1 year ago by avatarmanel.
Viewing 3 posts - 1 through 3 (of 3 total)
  • #193410

    Hi,

    Wondering if anyone here has tried coding a rolling return indicator on PRT ? Any help would be appreciated, couldn’t see anything in the search results. Basic calculation is eg :

    1yr rolling return % as of today = (Today’s price (T) – (T-365 days price)) / (T-365 days price) x 100

    1yr rolling return % as of yesterday would be =  (T-1 price) – (T- 366 price) / (T-366 price ) x 100 etc etc

    Editable fields would be rolling period to look back over ie 1yr, 1 month, 1 week, 1 hour etc

    The use for this is varied. Returns generally ebb and flow in cycles and each instrument has its own pattern eg if xyz stock goes up 20% over a priod of a month then it usually stalls/corrects regardless of technicals, index correlation etc It can be a useful indicator of momentum tops and bottoms and it works over multiple timeframes. So  if a stock shows an increase in a rolling return from 5% to 20% on a monthly basis and stays there for a few months, it doesn’t mean its stalling (it’s still returning 20%/mth) but that the initial sharp momentum that took it from 5% to 20% has dissipated.

    It’s also very useful in viewing rolling annualised returns for an index/stock over time as well and can also be used as a screener.

    Please ask if you have any questions. There is something like this on trading view but its not quite as accurate functionally.

    Many thanks in advance !

    #193648

    I made this one, please checkif it’s what you asked for:

     

    1 user thanked author for this post.
    #193774

    Hi – Thank you so much for the indicator, much appreciated. It works perfectly as designed. I have random sampled a few periods and the calculations seem fine.

    Short term and intraday/intraweek timeframes will work as expected but for people who use this please be aware that I have just noticed after testing that over longer time periods the calculations will differ to those based on calendar dates. So basically a 365 rolling period return on a daily chart is in fact comparing almost 1.5yrs (roughly) as the indicator compares the no. of daily candles and not dates. If you want to get a more accurate representation of 1yr returns you should use 252 (average number of trading days in the US), 126 for 6m etc etc. Not exact but close enough until someone can modify the above for calendar dates.

    This indicator can be used to help identify interim/major cycle tops/bottoms for instruments as each one usually has its own unique band between which it oscillates. It is not disimilar to stochastic/rsi but those are standardised and “one size does not fit all” whereas this is more customised to each instrument.

    Next step is to code one up referencing dates and also develop a screener for each version. After this I hope to develop some systems to trade these bands and backtest. All input and suggestions welcome !

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login