Download MetaTrader 5
To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
sorasit
358
sorasit 2014.06.02 12:25 

OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES);

What return value to OrderType() ? If this ticket number already closed .


thank you

Amir Yacoby
1128
Amir Yacoby 2014.06.02 13:14  

SELECT_BY_TICKET you don't need MODE_TRADES, it selects the ticket from live and history together.

Only in SELECT_BY_POS you should inform MODE_TRADES or MODE_HISTORY.

So, for select ticket you get the original order type, no matter if the deal is closed or open 

whroeder1
13656
whroeder1 2014.06.02 13:28  
amir_avatar: you get the original order type, no matter if the deal is closed or open
If the original order type was a pending order and it opened, it's now a buy or sell.
sorasit46:OrderSelect SELECT_BY_TICKET If this ticket number already closed
When you select by ticket, mode is irrelevant. If you don't know if it's closed, you can check OrderCloseTime() for non-zero.
sorasit
358
sorasit 2014.06.02 14:31  
Thank you
/
To add comments, please log in or register