Hi,
I have some indicators which display text on the screen using the ObjectCreate function
after I remove the indicator, the text is still visible.
What I thought was needed was ObjectDelete in the deinit function but that doesn't seem to do the trick.
in another indicator I have I don't even have the Objectdelete and I have no problem with the text being removed.
thanks
If your indicator has created a graphic object, then your indicator should be removed afterward - your indicator should remove the graphic object.
Example:
The indicator Size of candles (text) creates OBJ_TEXT objects and deletes them in OnDeinit.
If your indicator has created a graphic object, then your indicator should be removed afterward - your indicator should remove the graphic object.
Example:
The indicator Size of candles (text) creates OBJ_TEXT objects and deletes them in OnDeinit.
thanks for your quick reply
so should:
int OnDeinit()
{
ObjectDelete("whatever the name of the indicator is called");
}
always delete whatever you created?
just curious why it has to be OnDeinit and not deinit?
quite new to MQL4 so not sure yet.
thanks
Please go to the link I gave - you will see that my code is MQL5.
- 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,
I have some indicators which display text on the screen using the ObjectCreate function
after I remove the indicator, the text is still visible.
What I thought was needed was ObjectDelete in the deinit function but that doesn't seem to do the trick.
in another indicator I have I don't even have the Objectdelete and I have no problem with the text being removed.
thanks