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

 

OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES);

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


thank you

 

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 

 
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.
 
Thank you