Features of the mql5 language, subtleties and tricks - page 187

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
Has anyone come across a multi-timer solution so that I don't have to reinvent the wheel myself?
I don't see the implementation as being complicated by using pointers to the function. It is unlikely that it would not have already been implemented before me.
That is, the original task is to create a timer with any periodicity and assign to it a function to handle the timer event. And there can be any number of timers.
Like this:
No one has come across a multi-timer solution
I'm sure I've seen it at the Buy More a long time ago.
I can't find it. Strange.
OK, I'll implement it myself. Shouldn't be any pitfalls. I'll post it at the Buy More.
I.e. the initial task is to create a timer with any periodicity and map its timer event handling function to it. And there can be any number of timers.
simpler variant won't do?
UPD: And so, you can use fxsaber code as a template
here's how to make it so that all objects are automatically deleted https://www.mql5.com/ru/forum/325418/page4#comment_16116740
I can't find it. Weird.
OK, I'll implement it myself. Shouldn't be any pitfalls. I'll put it in the Buy More.
done
https://www.mql5.com/ru/code/31306
a simpler version wouldn't work?
UPD: otherwise, you can use fxsaber code as a template
here's how to make it so that all objects are automatically deleted https://www.mql5.com/ru/forum/325418/page4#comment_16116740
Of course, you could do it that way. But less readable and more difficult to manage.
made
https://www.mql5.com/ru/code/31306
Once upon a time (roughly) did this.
It's inconvenient to use with classes.
class CWithTimer {
public:
void CallMeByTimer();
};
And external (to the class) timer with pointers to the function is powerless.
once upon a time (roughly) did so.
It's inconvenient to use with classes.
class CWithTimer {
public:
void CallMeByTimer();
};
And external (to the class) timer with pointers to the function is powerless.
If you mean function as a class method, then yes, I agree. Figured it out myself yesterday and am puzzling over how to get out of it.
The object must contain a pointer to a class with a timer.