I added onceperbar filter to allow the EA to only check it at the opening of a new candle but sometimes when the opening candle is below the MA it is closes it self.
Please take a look at picture.
The position was opened at A and the EA should hold the position until the candle closes below the MA which is C but somehow the EA closes the position at B where the opening of the candle was below the MA.
The exist program is written like this.
if trade is running ---> once per bar ---->condition(when the candle is below MA) ----->close each profitable trade.
What can I do so the EA don't exit at such location. Thanks

