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