This is false
should be :
And a "continue" instead of a "break"
With your help, sell position is taken by the EA.
I keep for ( i = OrdersTotal () .. because I have seen somewhere with i = 0 that can bring error with a lot of trade.
Thanks again for your help :)
Next step for me is to add Trailing stop in my code.
Hi again guys !
I have a question about automatic trading.
So, my EA take buy position when the Candle  passed over the Average Moving but I have a big problem.
In fact, if Candle  go below this Average Moving, EA closed this Trade. Even if, it's the same Candle.
I don't understand because when a trade is opened, my close conditions are not met.
Thanks in advance if you can help me.