
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
Using the timer manager. I wanted to write an article, but then it got sidetracked. Although it may not be enough for an article.
You won't get it in a specific time because of single-threaded code and event queue, but with an average error less than a second (maximum is limited by the maximum time of event execution by the code).
The more so, there is only one timer.
Do you need it?
Yes, the error is almost imperceptible. Why don't you put it in Code Base at once? It'll get lost on the forum, and someone else will need it.
Not quite finished, I'm busy with my File Unlimited for 5. I'll be finished soon.
The point is not about whether we'll need it or not. It's the only normal and correct way to work with multiple timers.
Not quite finished, I'm busy with my File Unlimited for 5. I'll be finished soon.
Is there any way to get the EA to generate Timer events at a specific time? For example, at the start of the last minute of the hour or the day.
Again, this is a great substitute for the Sleep function in the turkeys, and again, a second is a bit much.
The topic is open for discussion. What do you think?
There is one nuance. The timer in the indicator doesn't work if it's not attached to the chart. Therefore, even a second timer is often useless in indicators.
Here is a solution for monitoring events of less than one second. Perhaps, a timer can be done in conjunction with GetTickCount().
What is the problem? You need to run normal timer and analyze the time. If time is not suitable - exit OnTimer at once.
And why should I bombard the queue with every second Timer events and waste my time on checking OnTimer() every second, if I want to run OnTimer() once per day (per hour etc.) but at a certain time?
I believe that it would be much more rational and elegant to use this function with two parameters:
Which is what the SD suggested.
Addition: the value of the delay parameter can be easily and once calculated in OnInit().
And why...
Well, actually, that's what I was suggesting. Just wrapped up in a convenient package.
Once a second is a scary pittance, especially if you skip unnecessary events.
and this.
not to do it at all, as it's just bullshit.
not to do it at all, as it's just bullshit.
I'll ask as a bullshit expert. What is the idea behind this delay(int delay=0), and for what purpose was it (delay) suggested? How did you understand it?
And second question I want to clarify, what is the point of specifying"number of milliseconds for 1 second delay for OnTimer"? What goal are you trying to achieve? For example, to delay every second in OnTimer by three milliseconds?
Well, that's actually what I was suggesting. Just wrapped up in a convenient package.
Once per second is a scary pittance, especially if you skip unnecessary events.