bool select; select=OrderSelect(your_ticket,SELECT_BY_TICKET); if(select) { if(OrderCloseTime()==0) { //order is open } if(OrderCloseTime()!=0) { //order is closed } }
![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
Dear,
I am little bit confuse with OrderSelect(). I wrote below functions
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