Order Count Issue
When you call GetOrders function, first parameter passed (int anActionCode1) must be OP_BUY, AND second parameter (int anActionCode2) must be OP_SELL. Otherwise you would have to remove yellow highlighted part of the code:
if (Symbol() != OrderSymbol() || MagicNumber != OrderMagicNumber() || (OrderType() != anActionCode1 && OrderType() != anActionCode2)) continue;
Regards.
When you call GetOrders function, first parameter passed (int anActionCode1) must be OP_BUY, AND second parameter (int anActionCode2) must be OP_SELL. Otherwise you would have to remove yellow highlighted part of the code:
Regards.
The following function works fine if I only get signalBuy or signalSell, if I have position opened in both buy and sell the (the Ea will allow multiple buy and one sell, and viceversa) the order count and order lot go wrong as shown below the code: