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?
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..
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:
Bottom1 = lowest[5](low) //lowest from bar 0 through bar 4
Bottom2 = lowest[30](low[21]) //lowest from bar 21 through bar 50