Can someone tell me if I'm missing something here. I am backtesting this EA using Every Tick mode and part of the logic is this:
if (CurrentBarOpen > TMAMidLine && CurrentBarLow > TMAMidLine) Order = SIGNAL_SELL;
and
if (CurrentBarLow < TMAMidLine) Order = SIGNAL_CLOSESELL;
At one point, I got dozens of trades that Sold and then Closed immediately for a 6 pip loss. How can this happen? If the Low is below the MidLine it should not open orders and if the Low is above the MidLine it should not close the order. At that moment it seems that the Low was equal to the MidLine but this violates the logic. The order should not be closed until <, and once < it should not open another order. If someone can explain why this is happening, I would be very grateful.
if (CurrentBarOpen > TMAMidLine && CurrentBarLow > TMAMidLine) Order = SIGNAL_SELL;
and
if (CurrentBarLow < TMAMidLine) Order = SIGNAL_CLOSESELL;
At one point, I got dozens of trades that Sold and then Closed immediately for a 6 pip loss. How can this happen? If the Low is below the MidLine it should not open orders and if the Low is above the MidLine it should not close the order. At that moment it seems that the Low was equal to the MidLine but this violates the logic. The order should not be closed until <, and once < it should not open another order. If someone can explain why this is happening, I would be very grateful.