Hi,
why do you have: if(OrderType()<=OP_SELL.....
??
this should be
if(OrderType()==OP_SELL.....
lexygoo:
Hi,
Hi,
why do you have: if(OrderType()<=OP_SELL.....
??
this should be
if(OrderType()==OP_SELL.....This means that only OP_BUY and OP_SELL are concerned, not the pendings.
Server communication
I think the order takes a while to reach the brokers server and be verified there. This is only a guess. One ea I had was made to trade at exactly 12H00 - but could only do so on 2 currencies simultaneously else it got a 'dispatch busy' kind of error.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Could someone explain to me why my EA never executes simultaneous trades in different pairs. It can execute in all pairs but cannot do it simultaneously. Each time a trade opens in one pair, it stalls all potential trades with other pairs.
Here's the code that defines when to start the trade:
total=OrdersTotal(); // check the total active orders
for(count=0;count<total;count++) // if there are active totals then proceed
{
OrderSelect(count, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==MAGIC))
{
: The code here is never reached if one order is open in a specific pair.
Thanks for your help in advance.
If you need the whole code, please let me know so I can send it to you by email.