Major OrderSelect() bug! Seen on backtester and demo - might be on live too

Back to topics list To post a new topic, please log in or register
avatar
41
dudufx 2015.02.20 18:05
 

This has surfaced while working these days. It seems that, regardless that an order is active or closed (we tried only with market orders), both modes OrderSelect(), MODE_TRADES and MODE_HISTORY, will return true. If an order never existed, both will return correctly, false. Test it yourself: launch a market order and try the following script:

 

void OnStart()
  {
   int ticket=41341306;// Your test Ticket!!!!!
   if (OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)==true)
     Print("MODE_TRADES: ticket ",ticket," is SELECTED");
   else
     Print("MODE_TRADES: ticket ",ticket," is NOT SELECTED");
     
   if (OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)
     Print("MODE_HISTORY: ticket ",ticket," is SELECTED");
   else
     Print("MODE_HISTORY: ticket ",ticket," is NOT SELECTED") ;
  }
avatar
12985
WHRoeder 2015.02.20 19:14 #
 
Read the documentation OrderSelect - MQL4 Documentation

Note

The pool parameter is ignored if the order is selected by the ticket number. The ticket number is a unique order identifier.






avatar
41
dudufx 2015.02.23 11:35 #
 

Thanks 

Back to topics list  

To add comments, please log in or register