Download MetaTrader 5
MQL5 ReferenceDate and TimeTimeTradeServer 

TimeTradeServer

Returns the calculated current time of the trade server. Unlike TimeCurrent(), the calculation of the time value is performed in the client terminal and depends on the time settings on your computer. There are 2 variants of the function.

Call without parameters

datetime  TimeTradeServer();

Call with MqlDateTime type parameter

datetime  TimeTradeServer(
   MqlDateTime&  dt_struct      // Variable of structure type
   );

Parameters

dt_struct

[out]  Variable of structure type MqlDateTime.

Return Value

Value of datetime type

Note

If the MqlDateTime structure type variable has been passed as a parameter, it is filled accordingly.

To arrange high-resolution counters and timers, use the GetTickCount() function, which produces values in milliseconds.

During testing in the strategy tester, TimeTradeServer() is simulated according to historical data and always equal to TimeCurrent().


Updated: 2015.12.03