Movement indicator

Forums ProRealTime English forum ProBuilder support Movement indicator

Viewing 14 posts - 1 through 14 (of 14 total)
  • #156496

    Hello,

    The attached image shows the daily percentage movement of the S&P 500 over the last 10 years.

    Someone can help me create an indicator, similar to the pivot point and its SDs, that would indicate the levels on a daily basis: +1%, +2, +3%, -1%, 2% and -3%.

    Ideally, an indicator, also similar to the pivot point, would be created that would indicate the standard deviations (annualized) of daily return: 1, +2 and +3 standard deviations and -1, – 2 and -3 standard deviations:
    https://blogs.cfainstitute.org/investor/2012/08/27/fact-file-sp-500s-sigma-events/

    Thank you.

    #156604

    Here’s a picture that shows what I want:
    lines that are +/-1%, +/- 2% and +/-3% of the previous day’s close.
    No need to color the buying and selling areas, just to have an indicator with lines similar to the pivot points.

    #156613

    Something like this?

     

    1 user thanked author for this post.
    #156614

    So, roughly, that’s the standard deviation of an “all time” average of the SP500?

    #156621

    I just coded simple percentage of yesterdays closing price as that is what the second post described and showed in the image.

    1 user thanked author for this post.
    #156636

    Yes, that’s exactly it! Thank you very much.

    #156643

    Is it possible to create the same indicator but this time using 1, 2 and 3 standard deviations ?

    The most commonly used calculation method is the standard deviations annualized of daily return.
    It would be ideal to have such an indicator because it would indicate the levels used by many mean reversion algorithms.

    But if it’s too difficult to program with PRT it will be easier to create an indicator with standard deviations of daily returns that takes into account the days displayed on the graph (as on your post).

    #156644

    Hello Nicolas. Not necessarily “all time” because the markets are much more volatile these last decades.
    The most commonly used calculation method is the standard deviations annualized of daily return.
    But if this is too difficult to program with PRT, an indicator with standard deviations of daily returns that take into account the days displayed on the chart is a good alternative.

    #156684

    Hello @Vonasi, I can’t call the indicator to use it in an algorithm.
    The idea is to buy when the price has rebounded close to the -2% level.
    I created a simplified version of the indicator with only this -2% level:

    Mais lorsque je lance le backtest de l’algo,  aucuns trades ne ressort :

    Can you help me find the error?

    #156703

    Annualized Standard Deviation = Standard Deviation of Daily Returns * Square Root (250)

     

    1 user thanked author for this post.
    #156710

    Surely the SQRT(250) relates to 52 times 5 candle weeks minus holidays? On PRT’s 6 candle weeks something like 302 would be more accurate? Or perhaps we could use something like my days in year calculator from here:

    https://www.prorealcode.com/topic/how-many-bars-in-a-year-indicator/

    #156712

    I can’t call the indicator to use it in an algorithm.

    Your indicator does not return a value to be used in the strategy – it just draws a segment.

    1 user thanked author for this post.
    #156826

    Thank you @Vonasi. I modified the last line of the indicator in several ways:

    There has been a change with a line that connects each daily segment.
    But on the other hand there is still no result when I run the algorithm.
    There is even an error report that is displayed at the end of the backtest regardless of the final line.

    Do you know how to return the result that will be taken into account by the algorithm?

    #156828

    Line 5 :

Viewing 14 posts - 1 through 14 (of 14 total)

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