Hi,
I cannot figure out how to test if a condition is true in a predefined period or a number of bars. I have been trying to use barIndex with little luck. Can someone please offer some guidance? thank you.
I’d like to write a code like this:
IF condition[period] THEN
do_someting
ENDIF
Two cases:
- the conditions need to be met on ALL periods
- the conditions need to be met on AT LEAST ONE of the periods
IF summation[period](condition) = period THEN
do_someting
ENDIF
IF summation[period](condition) THEN
do_someting
ENDIF