Features of the mql5 language, subtleties and tricks - page 106
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
It doesn't work because the global variable is emulated with MT5 Tester. They also use TimeCurrent ().
Sorry, confused with MT4. Works in MT4, but not MT5.
Application
HH Is there an easier way to find out the local time of the computer in the Tester?
It's not rational in this way. You need to get the real time only once, and then calculate the difference using GetTickCount or GetMicrosecondCount.
You need to get the real time only once and then calculate the difference using GetTickCount or GetMicrosecondCount.
Yes, I agree.
And the code?
You need to get real time only once and then use GetTickCount or GetMicrosecondCount to calculate the difference.
The time density in the tester is completely different. It won't work.
And the code?
Updated.
Updated.
In GetTickCount overflow should be taken into account
If you subtract another UINT from one UINT, the result will always be correct, even if there is an overflow.
Illustration
log
If you subtract another UINT from UINT, the result will always be correct, even in case of overflow.
Probably, it meant that one pass can last longer than ~50 days (then GetTickCount goes through full cycle). But that's out of the realm of practice.