MQL4 Reference Trade Functions OrderTicket
Returns ticket number of the currently selected order.
Ticket number of the currently selected order.
The order must be previously selected by the OrderSelect() function.
Print("OrderSelect failed error code is",GetLastError());