MQL4参考 交易函数 OrderCloseTime


Returns close time of the currently selected order.

datetime  OrderCloseTime();

Returned value

Close time for the currently selected order. If order close time is not 0, then the order selected and has been closed and retrieved from the account history. Open and pending orders close time is equal to 0.


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


     datetime ctm=OrderOpenTime();
     if(ctm>0) Print("Open time for the order 10 ", ctm);
     if(ctm>0) Print("Close time for the order 10 ", ctm);
    Print("OrderSelect failed error code is",GetLastError());