My EA is not working properly on MT5
- Fill Policy - Trading Principles - Trade - MetaTrader 5 for Android
- Fill Policy - Trading Principles - Trade - MetaTrader 5 for iPhone
- Structures and unions
double entryPrice = (localHigh[0] + localClose[0]) / 2;
it looks like your entry price calculation is wrong. may be you need to calculate from candle 1 not 0!
I do not know logic behind your strategy but current high and close for JUST opened candle are same values. I mean, in first tick of current candle high=low=open=close.
you can not set a pending order for current price specially if there are limits like Stop Level or Freeze Level.
You may check this. You cannot open a pending order too close to current price.
if(entry>Bid+SYMBOL_TRADE_FREEZE_LEVEL*_Point) trade.SellLimit(...);