how to find the biggest candlestick over the last 10 bars

Forums ProRealTime English forum ProBuilder support how to find the biggest candlestick over the last 10 bars

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

    Hi,

    How do I test the current candlestick is the biggest candle over the last 10 bars? I tried the following but didn’t work

    range>range[10]

     

    #42666

    You line of code tests the current RANGE with that of the 10th bar before, but there can be greater ones in the middle!

    Try this one:

    It makes a sum of your condition for the number of bars in brackets. The output is in how many bars your condition is true, even not consecutively. If you need it to be consecutive you have to test the output against the number in brackets to check if they match.

    You could also use FOR…NEXT loops, but it’s far more time consuming!

    I tested it on AudCad DAILY and found a match on May 13th, 2013, but the odd thing is that it seems to output a value which is 2 less than the number in brackets. 12 will found 10, 11 will output 9…

    Sorry, can’t figure out why, you will have to experiment a bit.

    GRAPH is useless for the logic, I used it just for debugging purposes only.

    #42721

    Sorry, but SUMMATION is not the correct instruction, because it checks that each range, from the current one down to the nth one, is greater that the previous. So they need to be consecutively smaller that the previous one.

    So the correct solution is to use FOR… NEXT loops:

     

    1 user thanked author for this post.
    #42735

    Thanks Roberto I’ll try your suggestion.

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