How to get the max or min of a subset?

Forums ProRealTime English forum ProBuilder support How to get the max or min of a subset?

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

    Hi,

    One can get the min or max of a dataset as myMIN = lowest[50](CLOSE). But now I want to get the min of last 30. Surely I can do this with a FOR loop. But it will be efficient when I can do as: min = lowest[last30](CLOSE).

    What I want is to get the double bottom with 50 bars. The first bottom should be inside the first 5 bars and the second should be inside the last 30 bars (from the 20th to the 50th).

    Is this possible?

    #91936

    Rough idea: use BARINDEX to count if the last lowest price saved in a variable is older than 30 bars or not. I let you think of it, let me now if it is not clear enough and I’ll try to code it accordingly to what I think about..

    #91947

    Using FOR..NEXT will allow you to know on which bar that LOW happened, but if you don’t mind when it happend, this can do:

     

    #92009

    Many thanks!

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