
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
This issue is solved like two fingers... You know what...
In OnDeinit it is necessary to condition the reason for deinitialisation before deleting the object... If it is NOT a period change, then the object is deleted. AND THAT'S IT...
Yes, I can not delete some object or resource at TF change, I can even save some small arrays through object-resource, and write in resource information about TF change, but the point isDeunit may start to be executed after the unit has been executed in a new timeframe - how should I inform the unit that the TF has changed and the old data should be read? Isn't it wrong?
What kind of logic is spoiled?
When you change timeframe, a new copy of the indicator is created that knows nothing about the previous copy. For a certain period of time (very short) both copies of the indicator exist in parallel. Then the previous copy is unloaded.
Read documentation https://www.mql5.com/ru/docs/runtime/running
I have read the description of the link, but haven't found such information, as you've given. And if it is really so, it is a great problem for indicator developers. It's very strange and very bad that such logic is adopted for reloading indicators when you change timeframe. Why do we need the existence of two copies of the same indicator in memory? Who benefits from it? What does it give? It would be more logical to complete the execution of one copy of the indicator, to unload it and only then to load the next copy.
And that's ALL!?
I've been experimenting and using this reason code(REASON_CHARTCHANGE) as much as possible. And what's the use if all variables are set to their original state again, and OnDeinit can be executed after OnInit of a new TF
Slava has answered this question, new indicator, new calculations. And this is fair.
And apparently this problem will never be solved.
And I have faith in the development team, they are great guys and have done an incredible amount and will do more. I just haven't gotten around to it yet. True, you always have to get feedback from them with bells and whistles. :))
My task is to convince them that it needs to be done. Although I do not exclude that they will convince me that it is better not to do, maybe I do not understand something.
And I have faith in the development team, they are great guys and have done an incredible amount and will do more. I just haven't gotten around to it yet. But I always have to get feedback from them with tambourines. :))
My task is to convince them that it needs to be done. Although I do not exclude that they will convince me that it is better not to do, maybe I do not understand something.
Slawa, what does the phrase in the documentation"Librariesdon't handle any events" mean?
Very vague
- When Inite sets the colour of the main graph to transparent.
I draw my own chart (according to my parameters)
I want it to restore the colour of the main chart after removal of my indicator
- In DeInit I restore the colour of the main chart
When changing the TF I mean first DeInit (restore the colour), and then Init (go back to being transparent)
The execution of commands is not sequential; periodically, when changing the TF
periodically the main chart (with restored colour) is overlaid on my indicator.
Here is for example one "logic breakdown".
Maybe to try to assign to graphical objects the TF period as a component of their name prefix,
and then apply something like this:
- When Inite sets the colour of the main graph to transparent.
I draw my own chart (according to my parameters)
I want it to restore the colour of the main chart after removal of my indicator
- In DeInit I restore the colour of the main chart
When changing the TF I mean first DeInit (restore the colour), and then Init (go back to being transparent)
The execution of commands is not sequential; periodically, when changing the TF
periodically the main chart (with restored colour) is overlaid on my indicator.
Here is, for example, one "logic breakdown".
And that's ALL!?
I've been experimenting and using this reason code(REASON_CHARTCHANGE) as much as possible. And what's the use if all variables are set to the original state again, and OnDeinit can be executed after OnInit of the new TF
Try to update terminal to version 1065. In previous versions there was an error of reinitialization just during timeframe change. May help :)
https://www.mql5.com/ru/forum/187690
Try to update the terminal to version 1065. Previous versions had a reinitialisation error just by changing the timeframe. Might help :)
https://www.mql5.com/ru/forum/187690