This is not a lag. You output the time from OnTimer to the screen, then wait for 500 ms. During this 500 ms the time changes, but OnTimer has not yet been called.
You need to synchronize - set EventSetTimer(1) exactly at the moment when "TimerCurrent changed".
Tried this way to synchronise
It does not work. And I have bad thoughts towards MT5 lag. See for yourself how your script will behave with these changes.
You have millisecond timer in your code in OnInit, in your post you write a regular one-second timer. I guess you want to use EventSetTimer(1) after all?
Vasiliy Pushkaryov: You have millisecond timer in your code in OnInit, in your post you write regular, one-second timer. I guess you want to use EventSetTimer(1) after all?
First the first timer is synchronised, then the second timer is set.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Set the timer for half a second. It got a little better. Okay, let's keep it that way for now.
Show me the code.
Show me the code.
I've cleaned up the excess.
But such lags can often be caught manually, or is 500ms normal?
I've cleaned up the excess.
But such lags can often be caught manually, or is 500ms normal?
I've tried this construction instead of removing the marker, just replacing the text if the marker exists, but I haven't noticed any difference
is it often possible to catch lags like this manually, or is it 500ms normal?
This is not a lag. You display the time from OnTimer, then wait for 500ms. In that 500ms the time changes, but OnTimer has not yet been called.
You need to synchronize - set EventSetTimer(1) exactly at the moment when "TimerCurrent changed".
Tried this way to synchronise
It does not work. And I have bad thoughts towards MT5 lag. See for yourself how your script will behave with these changes.Tried this way to synchronise
It does not work. And I have bad thoughts towards MT5 lag.OnTimer is not called after the set number of ms. Hence the accumulated error and the observed lag. Bug!
This is not a lag. You output the time from OnTimer to the screen, then wait for 500 ms. During this 500 ms the time changes, but OnTimer has not yet been called.
You need to synchronize - set EventSetTimer(1) exactly at the moment when "TimerCurrent changed".
Tried this way to synchronise
It does not work. And I have bad thoughts towards MT5 lag. See for yourself how your script will behave with these changes.You have millisecond timer in your code in OnInit, in your post you write regular, one-second timer. I guess you want to use EventSetTimer(1) after all?
First the first timer is synchronised, then the second timer is set.
First there is synchronisation via the first timer, then the second timer is set.
OnTimer is not called after the set number of ms. Hence the accumulated error and the observed lag. It's a bug!
The script in the chart comment shows this bug