On screen calculator

Forums ProRealTime English forum ProBuilder support On screen calculator

Viewing 6 posts - 1 through 6 (of 6 total)
  • #247231

    Hi,

    Will it possible to do an indicator that calculates the difference in price between two moving averages, example a 20  and 50? To be displayed on a chart.

    Regards,

    Segie

    #247235

    Hi,

    Something like that, with a pixel position from top right corner (hence the negative Xpixel and Ypixel values, customisable as long as they remain negative to indicate going leftward and downward from top right corner).With another use of drawtext, it would also be possible to just keep display on a given barindex rather than a pixel position if preferred.

     

     

     

    2 users thanked author for this post.
    #247245

    Works well. Thank you very much

    #247246

    Can you also help to display the difference as a percentage below the calculation?

    e.g. MA20=2  and MA50= 8

    The difference = -6

    (-6/2) X 100 = 300%

    Regards,

    Segie

     

     

    #247254
    JS

    Hi,

    The current calculation is the absolute difference between the two averages:

    AbsDiff = (MA20 – MA50)

    If you want to calculate the relative difference in percentages:

    RelDiff = (MA20 – MA50) / MA50 * 100
    Or alternatively written as:
    RelDiff = (MA20 / MA50 – 1) * 100

    2 users thanked author for this post.
    #247262

    Looks good. Thank you

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

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