OrderSend() error 129

Back to topics list To post a new topic, please log in or register
avatar
120
DeanDeV 2015.06.10 11:30
 

Hey guys,

 I send 2 orders at the exact same time, yet one returns this error and the other gets placed just fine. Any reason why this would happen?

int buyMA=OrderSend(Symbol(),OP_BUY,Lotsize,Ask,3,Ask-(StopLoss*Point),Ask+(TakeProfit*Point),"Buy order",MagicNumber,0,clrBlue);
  if(buyMA>0) Print("Buy order placed successfully.");
  if(buyMA<0) Print("Buy order failed to place, error#",GetLastError());

int buyMAntp=OrderSend(Symbol(),OP_BUY,Lotsize,Ask,3,Ask-(StopLoss*Point),0,"Buy order",MagicNumber,0,clrBlue);
  if(buyMAntp>0) Print("Buy order placed successfully.");
  if(buyMAntp<0) Print("Buy order failed to place, error#",GetLastError());

 The second order fails. It has done this 2 days in a row now?

 Please help.  

avatar
13006
WHRoeder 2015.06.10 16:11 #
 
It takes time to open an order (up to minutes). By the time you try to send the second one Ask may be very much out of date. You must RefreshRates() between server calls.
avatar
120
DeanDeV 2015.06.10 16:17 #
 
WHRoeder:
It takes time to open an order (up to minutes). By the time you try to send the second one Ask may be very much out of date. You must RefreshRates() between server calls.
Okay, thank you.
Back to topics list  

To add comments, please log in or register