, then add this prefix to the name of your objects and when you need delete just call
ObjectsDeleteAll(0, OBJ_PREFIX);
And for comments the Comment("") is enough. But is a better idea replace the comment by an object as well, because not only one program can write comments, so you don't know if the comment comes from your program or another.
Instead, define a constant as prefix for all your objects, for example,
, then add this prefix to the name of your objects and when you need delete just call
And for comments the Comment("") is enough. But is a better idea replace the comment by an object as well, because not only one program can write comments, so you don't know if the comment comes from your program or another.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thank you all for your answers 😉
The function has a maximum execution time that may not be exceeded. It is 2500ms.
Thank you very much 😉. Can you tell me where you found this information? I don't see it in the documentation for the OnDeinit() function.
Merci
Thank you very much 😉. Can you tell me where you found this information? I don't see it in the documentation for the OnDeinit() function.
In the documentation.
https://www.mql5.com/en/docs/runtime/event_fire#deinit
Discard my previous idea for deleting all objects on the chart. Unnecessary looping can cause lagging in the indicator.
You can do this to delete the objects your indicator created:
I overcomplicated it.
Discard my previous idea for deleting all objects on the chart. Unnecessary looping can cause lagging in the indicator.
You can do this to delete the objects your indicator created:
I overcomplicated it.
i was gonna say about that after read everything.
Actually this also is not the best.
Instead, define a constant as prefix for all your objects, for example,
, then add this prefix to the name of your objects and when you need delete just call
And for comments the Comment("") is enough. But is a better idea replace the comment by an object as well, because not only one program can write comments, so you don't know if the comment comes from your program or another.
i was gonna say about that after read everything.
Actually this also is not the best.
Instead, define a constant as prefix for all your objects, for example,
, then add this prefix to the name of your objects and when you need delete just call
And for comments the Comment("") is enough. But is a better idea replace the comment by an object as well, because not only one program can write comments, so you don't know if the comment comes from your program or another.
Good info, I will apply this myself, thanks
Thanks to all who gave input on this topic.
I just made a very simple Script from your comments and I think it works as it deleted a comment from the chart.
I only had the one comment to delete , so not a great test but here it is, I hope this helps someone.
Its only 6 lines as follows, save it in Scripts folder and Compile (0 errors, 1 warnings)
// DELETE ALL COMMENTS SCRIPT
int start()
{
ChartSetString(0, CHART_COMMENT, "");
}
//----------------------------------