Hi everyone, I would need some help for a little code. I am trying to code the following strategy : Wait for EMA 5 AND EMA 10 to cross but don’t enter After a certain number of bars, if EMA 5 is still above EMA 10 then you can enter the market The number of bars to wait is issued from a third indicator and this value is changing over time. I tried but didn’t manage to code properly this strategy. Any help would be very appreciated. If it really works I will publish it. Many thanks. // Indicators ind1 = ExponentialAverage[5](close) ind2 = ExponentialAverage[10](close) ind3 = customvalue // IF ind1 CROSSES OVER ind2 THEN BUY AFTER "customvalue" number of bars IF ind1 still > ind2