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.
Jose Francisco Casado Fernandez:
Thank you I will try that later on
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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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: