Horizontally shifting a MA in an indicator

Forums ProRealTime English forum ProBuilder support Horizontally shifting a MA in an indicator

Viewing 7 posts - 1 through 7 (of 7 total)
  • #35501

    Hi Everybody

    I wish to include a MA horizontally displaced by n bars  in an indicator.  I have scoured the manual but it does not include an example that includes this, nor is this option included in the syntax at the end of the manual.  If one reads the function help option whilst trying to construct the indicator reference is made to this,again with no example (see attached screen capture). Any help/suggestions greatly appreciated.  Thank you.

    #35527

    If you want to draw it on the right of the chart (in the “future”), then it is not possible with code sorry.

    If you want to get the value from the moving average from X bars ago, you can, use this kind of code:

     

     

    #35533

    Thanks Nicholas.  I realize that PRT cannot plot “into the future”.  Will try what you suggest and see if it works.

    #35549

    Just in case it’s ok for you to include your shifted MA on your indicator without coding, it might be worth adding that you may also shift horizontally your MA by hand in the property window of the added MA (top right of the property window, in the box just below the period number), that’s what the function help was refering to without giving example.

    #35552

    Hi Noobywan, yes I am aware of that.  Thanks.

    #35648

    What exactly is it that you are looking for? Because a simple linear extrapolation should be possible, at least.

    Ind1=ma [20]<br>
    Ind2=Roc [10](ind1)
    Ind3=ind1+ind2
    If close crosses ind3 [10] then…

    I hope you get the idea.

    #35670

    Hi Derek

    The solution suggested by Nicolas was exactly what I was looking for.

    Thanks

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

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