Cumulative Indicator Pro Real Code

Forums ProRealTime English forum ProBuilder support Cumulative Indicator Pro Real Code

Viewing 4 posts - 1 through 4 (of 4 total)
  • #108019

    Hello everyone,

    I’m building an indicator but I need it to be cumulative, like the OBV indicator (OBV of the previous period + the calculation).

    So I basically have the main calculation for the current candle, but I need to sum the value that I had for the previous candle which also had to be summed to the previous value and so on… But I don’t know how to make the indicator cumulative, could anyone help?

    Also: I need that the value of the first candle that is available to ProRealTime is 0, and then the indicator should start to sum and so make the indicator cumulative.

    I hope I explained my self, but thank you in advance for you help!

    #108030

    First candle and progressive tallying:

    MyInd is your current calculated indicator.

    MyTotal is the cumulative sum of your previous and current MyInd.

    #110589

    Thank you for the reply, unfortunately, I cannot manage to make it work… If I try to return MInd it works as before (obviously), but if I try to return MTot, it doesn’t plot anything, the indicator is completely blank…
    Thank you gain for your response, and thank you in advance for any other reply…

    [EDIT]

    I actually managed to make it work with your code, it was my fault: I was trying to divide a number which sometimes would be zero, and somehow it messed with the code… thank you again!

    #110590

    Yes, because the number is so high that it’s completely out of scale!

    Say you are working on EurUsd, and you want to tally the CLOSE value, after 2000 bars it will over 2000.00000, so if you return the total alone it will be plotted correctly, but if you return do much dofferent values it cannot scale them so to be both 1.0000 and 2,000.0000 are visible, you will see just one or a couple of flat lines.

    You’ll have to shrink your scale on the right side of your chart or make two different indicators.

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

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