Download MetaTrader 5
To add comments, please log in or register
Articles can help you to solidify your knowledge. Come and read them!
Jon Grah
367
Jon Grah 2015.08.31 14:56 

Why doesn't the TimeCurrent function print millisecond precision or allow the user to specify whether they want millisecond precision?  It doesn't make sense that the mt4 terminal expert/journal real-time logs, backtest journal logs, and server ping functions have access to millisecond precision, but the TimeCurrent function does not print millisecond precision to allow users to mark each transaction they want to log separately or print on their chart with millisecond precision.

Can someone comment on this and what (if any) workarounds exist?

Demos Stogios
184
Demos Stogios 2015.08.31 21:41  

Hello,

About the question "why millisecond precision is not provided by TimeCurrent()", I guess it is just a design decision of MetaQuotes; they may believe that we do not need ms precision, and if you ask me, we really do not. But anyway, there is GetTickCount(), with the "caveat" that it gives you milliseconds from the system start (not calendar time). Some other options could be to use C library or Windows API or some library in general providing timers

 

best regards 

Jon Grah
367
Jon Grah 2015.09.07 05:32  

I actually forgot that I asked this question almost 2 years ago and got good feedback:  https://www.mql5.com/en/forum/146837

But yes, automated traders do need at least millisecond precision for logging purposes.  How else do you prove which activity came first if you have several that occur on the same second?  You use precise timestamps, as not every activity has a ticket number.  Or you may re-use the same ticket number.  There is no good reason NOT to have millisecond / microsecond precision. A modern trading platform should have at least millisecond timestamps, just like historical tick data does.

Continue:  https://www.mql5.com/en/forum/146837

/
To add comments, please log in or register