It's not.
In switching period it happens randomically, but if i close chart and imemdiately reopen the same symbol, it always happens!
Simple to replicate... using Print() on init and deinit.
Maybe in my case it is most noticeble because in my deinit i use objectdeleAll and i have a lot of objects, so it keeps more time.
It's not.
should not could be the right answer.
Try switching fast between periods, it happens!
If you switch slowly periods, and if you close chart and wait some seconds before re-open same symbol, it does not happen because we wait the "right time" for deinit to end.
Is it a BUG or it works (badly) so?
![Documentation on MQL5: Chart Operations / ChartClose Documentation on MQL5: Chart Operations / ChartClose](https://c.mql5.com/36/40/documentation-on-mql5-chart-operations__5.png)
- www.mql5.com
OK, i found this thread: https://www.mql5.com/en/forum/160715
It was already discussed, 4 years from it, and no fix! GREAT MQ!
![OnDeinit() race condition and recalculation issues OnDeinit() race condition and recalculation issues](https://c.mql5.com/36/40/ondeinit-race-condition-and-recalculation.jpg)
- 2016.11.13
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
using indicators i noted a weird stuff: when i switch period, the OnInit of new period is called before OnDeinit of prev period...
How it is possible? Is OnDeinit call asynchronous?