Download MetaTrader 5

Need help on OrderSelect()

To add comments, please log in or register
Do you know that MQL5 has event handling?
web11 2015.12.23 15:01 


I am little bit confuse with OrderSelect(). I wrote below functions

Alert(OrderSelect(15958423, SELECT_BY_TICKET, MODE_HISTORY) +"   "+OrderSelect(15958612, SELECT_BY_TICKET, MODE_TRADES));

open trade open then MODE_HISTORY show true and MODE_TRADES also show true.

as i know history only show order cancel or close. then why "OrderSelect(15958423, SELECT_BY_TICKET, MODE_HISTORY)" return true.

but when i close the trade then also both function return true. why?

no trade but also show 'OrderSelect(15958612, SELECT_BY_TICKET, MODE_TRADES)' return true

please help me

Xiangdong Guo
Xiangdong Guo 2015.12.23 15:31  

Please read MQL4 Reference carefully.

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

Lorentzos Roussos
Lorentzos Roussos 2015.12.23 16:17  
bool select;
     //order is open
     //order is closed
To add comments, please log in or register