You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
High-performance time-handling functions applicable to the entire MQL5 date and time range (from 1 January 1970 to 31 December 3000):
(Based on the Neri–Schneider calendar conversion algorithm: see here)
The attached script file contains the source code and comprehensive tests.
What are ULL and U?
These unsigned divisors (3600ULL, 86400ULL,..) will force unsgnied division and modulus, esp. when the numerator is of datetime type (treated internally as signed long 64).
The datetime will be promoted to ulong before performing the division / modulus. This ensures faster optimizations by the compiler.
Signed division and modulus will require extra instructions to handle the signedness.
Check it on https://godbolt.org/
Signed vs. unsigned div/mod:
Results: