Hey guys, so I am experimenting MQL5 and I saw there is no more Deinit by default so you have to add it. I made a quick test of an indicator that display an object at OnInit but I want it to be removed when I remove the indicator so ObjectDelete. I added a OnDeinit func and put the ObjectDelete inside but for a mysterious reason the object created still doesn't get deleted when I remove the indicator o n Chart. Any help will be appreaciated. Thanks in advence.
- OnDeinit ObjectDelete not when market is closed
- " ChartIndicatorAdd " and Error 4114 for any chart symbol and current time frame. Is it important ?
- how to have the text removed after removing the indicator
Bryan Djoufack Nguessong:
Hey guys, so I am experimenting MQL5 and I saw there is no more Deinit by default so you have to add it. I made a quick test of an indicator that display an object at OnInit but I want it to be removed when I remove the indicator so ObjectDelete. I added a OnDeinit func and put the ObjectDelete inside but for a mysterious reason the object created still doesn't get deleted when I remove the indicator o n Chart. Any help will be appreaciated. Thanks in advence.
Hey guys, so I am experimenting MQL5 and I saw there is no more Deinit by default so you have to add it. I made a quick test of an indicator that display an object at OnInit but I want it to be removed when I remove the indicator so ObjectDelete. I added a OnDeinit func and put the ObjectDelete inside but for a mysterious reason the object created still doesn't get deleted when I remove the indicator o n Chart. Any help will be appreaciated. Thanks in advence.
Hello,
After deleting the object, you should add ChartRedraw()
.. and the object will disappear from the chart.
void OnDeinit(const int reason) { Print("Execute OnDeinit()"); //-- ResetLastError(); if(ObjectDelete(0, EDIT_NAME)) { Print("Object deleted."); ChartRedraw(); } else Print("Object deletion has failed. Error code: ",GetLastError()); }
Yohana Parmi #:
Hello,
After deleting the object, you should add ChartRedraw()
.. and the object will disappear from the chart.
Thanks it helped. Please can you check this also? Another issue I have

Indicator bugging on MT5 after Upgrading code to MQL5 from MQL4
- 2022.08.13
- www.mql5.com
Hey guys. So I've upgraded a the code of overlaychart to have some buttons and all and it worked well on MT4. So I decided to port it to MT5...
Btw, if I do that, then freelancers will be disappointed in me.
Please use https://www.mql5.com/en/job
You can find even better coders than me there.
Kind regards.

Trading applications for MetaTrader 5 to order
- 2022.08.13
- www.mql5.com
The largest freelance service with MQL5 application developers
Yohana Parmi #:
Btw, if I do that, then freelancers will be disappointed in me.
Please use https://www.mql5.com/en/job
You can find even better coders than me there.
Kind regards.
Okey thanks

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