Download MetaTrader 5

What return value ? if call OrderSelect by closed order ticket number.

To add comments, please log in or register
sorasit
359
sorasit  

OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES);

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


thank you

Amir Yacoby
1252
Amir Yacoby  

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
15569
whroeder1  
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
359
sorasit  
Thank you
To add comments, please log in or register