MQL4 Reference
Trading functions
OrderCloseTime
| datetime OrderCloseTime( |
) |
Returns 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.
Note: The order must be previously selected by the OrderSelect() function.
Sample:
if(OrderSelect(10,SELECT_BY_POS,MODE_HISTORY)==true)
{
datetime ctm=OrderOpenTime();
if(ctm>0) Print("Open time for the order 10 ", ctm);
ctm=OrderCloseTime();
if(ctm>0) Print("Close time for the order 10 ", ctm);
}
else
Print("OrderSelect failed error code is",GetLastError());
|
|
|