I don't know how to synchronise local andcurrent time, I can't find it in the help.
These are two different event handlers. OnCalculate() is triggered by a new tick, OnTimer() is triggered by the time that is set when you start the timer.
I don't know how to synchronise local andcurrent time, can't find it in help.
At the moment of a tick we count the difference TimeCurrent()-TimeLocal() - this is our offset relative to the broker; if this offset changes later, everything should be recalculated - at the start or appearance of bar D1, recalculate all the necessary times, to the local time - we wait for the time we have "counted" in the timer, at the same time check for unsynchronization, disconnection with the broker, re-set the local arrows.
These are two different event handlers. OnCalculate() is triggered by a new tick, OnTimer() is triggered by the time that is set when the timer is started.
Thanks, I see. Can the indicator work in OnTimer() ?
Thank you, I see. Can the indicator work in OnTimer() ?
The OnTimer() event works in the indicator. But you should not put the whole code into OnTimer(). There should be only the part responsible for tracking the time left till the end of the candle. Everything else must work in OnCalculate().
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.
Is it, current time subtract the opening time of the bar?
can OnCalculate() be inserted into OnTimer()?
I don't know how to synchronise local andcurrent time, I can't find it in the help.
These are two different event handlers. OnCalculate() is triggered by a new tick, OnTimer() is triggered by the time that is set when you start the timer.
how, not to do? only this minute you have to check, and sleep for 24 hours)
Then you can't do without a timer.
Thank you. now we need to make it work, as who, in the absence of a tic.
can OnCalculate() be inserted into OnTimer()?
I don't know how to synchronise local andcurrent time, can't find it in help.
At the moment of a tick we count the difference TimeCurrent()-TimeLocal()
- this is our offset relative to the broker; if this offset changes later, everything should be recalculated
- at the start or appearance of bar D1, recalculate all the necessary times, to the local time
- we wait for the time we have "counted" in the timer, at the same time check for unsynchronization, disconnection with the broker, re-set the local arrows.
These are two different event handlers. OnCalculate() is triggered by a new tick, OnTimer() is triggered by the time that is set when the timer is started.
Thanks, I see. Can the indicator work in OnTimer() ?
Thank you. Now we need to make it work in the absence of a tick.
The code should be inserted into OnTimer(). But, again, it cannot be used on history. So put 0 instead of i right away.
Thank you, I see. Can the indicator work in OnTimer() ?
The OnTimer() event works in the indicator. But you should not put the whole code into OnTimer(). There should be only the part responsible for tracking the time left till the end of the candle. Everything else must work in OnCalculate().
the moment the tic comes on...
Well... What if the tick doesn't come? It needs to "start" without the tick.
But, again, you can't use it on a story.
Sorry, I don't understand why you can't.