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 turns out that the method of usual indicator code improvement cannot globally solve the conflict with EAs in closed code that use objects.
I hope that improving the Expert Advisor will globally solve the conflict with all dashboard indicators (which is my task).
I wrote in the MT4 build 1353 thread, maybe the terminal programmers will pay attention.
P.S. I made changes in the owls and something skis did not go ...
Look through the whole code (indicator and Expert Advisor) to find out where and why ObjectGetXXX, ObjectFind, ObjectsTotal, ObjectName, etc. are called - they are synchronous and can seriously slow everything down. Try to get rid of them if possible.
Don't forget to call ChartRedraw()!!!! above...
Gentlemen moderators, I'm being attributed all sorts of nonsense and I'm not allowed to respond? Amazing!
Look through the whole code (indicator and EA) to find out where and why ObjectGetXXX, ObjectFind, ObjectsTotal, ObjectName, etc. are called - they are synchronous and can seriously slow down everything. Try to get rid of them if possible.
Don't forget to call ChartRedraw()!!!! above...
You just need to make OnChartEvent() wisely and not react to all events in a row. Or I don't know what is there... And why sit here and think for the guy who won't even condescend to show the code with the problem?
Now I have inserted a loop of 1000000 repetitions of ObjectFind() and ObjectGet() - everything is normal.
Gentlemen moderators, I'm being attributed all sorts of nonsense and I'm not allowed to respond? Amazing!
You're not the only one who's been subjected to such selectivity.
You just have to do OnChartEvent() wisely, and not react to all events in a row. Or I don't know what it is.... And why sit here and think for the guy who won't even bother to show the code with the problem?
Now I have inserted a loop of 1000000 repetitions of ObjectFind() and ObjectGet() - everything is normal.
Well, I'll write it for the fourth time, it's not hard for me.
https://www.mql5.com/ru/forum/379526/page9#comment_25865481
If you open the link, you will find an attachment with the code at the bottom of the post. Then you can read the posts, by whom and how the discussion was developed there.
The issue is not specifically in the proposed code (you can write any Expert Advisor with an object yourself), but in a global error that affects all Expert Advisors with objects (with a single exception) when working with the function of chart switching via an indicator.
Nikolay offered his solution, but I have errors with the work of such code, I'm dealing with the problem further.
You just have to do OnChartEvent() wisely, and not react to all events in a row. Or I don't know what it is.... And why sit here and think for the guy who won't even bother to show the code with the problem?
Now I have inserted a loop of 1000000 repetitions of ObjectFind() and ObjectGet() - everything is normal.
I have a vague doubt: have you ever written anything more complicated than a loop?
Well, I'll write for the fourth time, it's no problem for me.
https://www.mql5.com/ru/forum/379526/page9#comment_25865481
If you open the link, you will find an attachment with the code at the bottom of the post. Then you can read the posts, by whom and how the discussion was developed there.
The issue is not specifically in the proposed code (you can write any Expert Advisor with an object yourself), but in a global error that affects all Expert Advisors with objects (with a single exception) when working with the function of chart switching via an indicator.
Nikolay offered his solution, but I have errors with the work of such code, I'm dealing with the problem further.
Here are the changes:
I managed to get rid of terrible hangs. And if you press the buttons at a measured pace, everything is fine.
But if you start pounding like a woodpecker, you get hangs again, only they are different and shorter. I don't think
you can't get rid of them. Perhaps it is related to the timeframe construction.
I need to work on the buttons so that there are pressed/unpressed positions and introduce inertia so that the button is not pressed immediately.
A delay of 0.1 second would fix the situation and the user would not notice it.
--
Actually, without an expert you can hammer the buttons at a furious pace....
And here we are, I've completely got rid of the hangs.
It may be crooked, but the point is the main thing:
The point is to not delete an object when switching the chart.
We should see what happens there when Destroy()... if it is possible to leave it like that...
Hi all !)
I apologise, but if we are talking about mq4, then maybe it can be solved like this :?)
That's what else can create brakes:
Why?