Bizarre looping problem

Forums ProRealTime English forum ProBuilder support Bizarre looping problem

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

    This is bizarre. I basically want to get the average of the last x amount of bars.

    Even when I set the loop to 1 it doesnt calculate properly.

    Pseudo code should be something like this:

    1. Go back 10 bars and add up all the bar ranges
    2. Divide the total amount by the lookbackperiod when the loop has completed

     

    The calculations are completely incorrect. Im stuck as I cant see anything wrong with the code. Line 15 seems to be the problem but why?

    Note: I am running this on the m6e futures which is why I multiply by 10000

     

    #105185

    Does below (for Lines 9 and 10) make any difference?

     

    1 user thanked author for this post.
    #105186

    You are summing up 11 bars (0 – 10), not 10.

    will

    do?

    1 user thanked author for this post.
    #105188

    Yep. This works. Thank you!

    Also, thanks @GraHal for replying.

    Much appreciated.

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