I would like to check whether an indicator met certain criteria any given day within the past X bars.
For example: If Highest High for 500 days was met any day in the past 10 days, than do something...
I know I can use MAX() for HighestHigh. But I am not sure how to handle those 10 days. Is there any simple way? Should I use some kind of LOOP for it?
Some kind of:
For n from 1 to 10
if Close [1 to n] > MAX(Close, 500) then
...
Thank you
Petr
Comment