Hello, I’m trying to figure out how to program a code in which the buy order takes place after an event that happens 3 times in the last 10 days. The event is X in the following code: MyRSI = rsi[9](Close) RsiMin = MyRSI > MyRSI[1] and MyRSI[1] < MyRSI[2] and MyRSI[1] < 30 if RsiMin then RSIMin1 = MyRSI[1] Low1 = Low[1] for I = 3 to 80 if RSIMin[I] then RSIMin2 = MyRSI[I + 1] Low2 = Low[I + 1] x= Low1 < Low2 and RSIMin1 > RSIMin2 endif break next endif Thanks in advance, Assaf