OrderMagicNumber - Trade Functions - MQL4 Reference

MQL4 Reference Trade Functions OrderMagicNumber

OrderMagicNumber

Returns an identifying (magic) number of the currently selected order.

int  OrderMagicNumber();

Returned value

The identifying (magic) number of the currently selected order.

Note

The order must be previously selected by the OrderSelect() function.

Example:

  if(OrderSelect(10,SELECT_BY_POS)==true)
    Print("Magic number for the order 10 "OrderMagicNumber());
  else
    Print("OrderSelect returned error of ",GetLastError());