MQL 5 Deinit not working
- OnDeinit ObjectDelete not when market is closed
- how to have the text removed after removing the indicator
- " ChartIndicatorAdd " and Error 4114 for any chart symbol and current time frame. Is it important ?
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()); }
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
- 2022.08.13
- www.mql5.com
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.
- 2022.08.13
- www.mql5.com
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