![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
When you change thef.
If the indicators have trash in their buffers from the old timeframe, it may affect the timers as well.
Forum on trading, automated trading systems and strategy testing
New version of MetaTrader 4 build 1065
Sergey Klimov, 2017.04.14 16:34
When switching between accounts, the _Digits variable in the indicator does not change.
It's prettier.
It's prettier.
This is for those who talk about proper consistency in MT4.
Watch and understand that not everything is so pretty in MT4.
The queue is unambiguous.
Well, where is it unambiguous?
Try this primitive example. You will understand the "uniqueness" when switching the TF.
In this example, an object with coordinates of current time and price is created in OnInit. In OnCalculate this object moves together with the price.
In OnDeinit it is simply (logically) deleted.
When we switch the TF, the object appears and then disappears.
Why does this happen?
Because sometimes OnDeinit of the old TF deletes something that has already been created in OnInit of the new TF. It is not a bug! What should the programmer who created this example think and did not read this branch?
Well, where is she single-mindedly.
The timer was mentioned there.
What's the difference. You can put EventSetTimer in Unite instead of object creation, and put EventKillTimer in Deunite instead of object deletion. And this will not reduce uncertainty, because set timer will be killed by Deunite of old TF, and sometimes it won't. And it will be even worse, because at least you can see the object, but you can't see the timer - whether it works or not.
Maybe they've already invented it, haven't read the whole thing. If indicator creates panel, you can use global variable of terminal, increase its value by 1 in init and use it as an additive to names of graphical objects.
My task was different - to save parameters of the panel, for this I created global variables of the terminal in deinit. The solution is simple - to create global variables of the terminal in the inite and update each of them as parameters change in the graphic panel. Only delete variables in deinit if deinitialization is caused by removal of indicator.
If the indicator creates a panel, you can use a global variable of the terminal, increase its value by 1 and use it as an appendix to names of graphical objects.
What must a programmer who created this example think and hasn't read this thread?
I totally agree. Non-readers won't know about this feature and will kill their time trying to figure it out. And that would be hundreds of people... ...especially those who are beginners.
All you need is to fix a bug once and that's it.
What's the difference. You can put EventSetTimer in Unite instead of object creation, and put EventKillTimer in Deunite instead of object deletion. And uncertainty will not decrease, because set timer will be killed by Deunite of old TF, and sometimes it won't. And it will be even worse, because at least you can see the object, but you can't see whether the timer works or not.
It's all crutches. You just need to make the correct order in the terminal and that's all. First deinit the previous instance, and only then initialize the new one.
I totally agree. Non-readers won't know about this feature and will kill their time trying to figure it out. And that would be hundreds of people... especially sorry for beginners.
All you have to do is fix the bug once and that's it.
That's what I'm talking about!
I'm personally on a roll, as I feel I have an advantage over the majority, as I know how to deal with it all, not just in words, but in deeds as well. I have already made patches and added crutches to my programs.
I just don't understand why the developers stubbornly refuse to consider this "feature" a bug.
For instance:
Indicators should be used for their intended purpose.
In other words, the sequence of OnInit and OnDeinit indicator fulfillment when thechart symbol-period has changed should be of no concern to anybody
But in my example with the animated gif above, there is a definite bug for a programmer who hasn't read this topic! What is not done according to its intended purpose?