how to delete object after close custom indicator? - page 3

 
Then I have nothing to suggest except are you actually removing the indicator from the chart or just changing time-frames or inputs?
 
Does an printf statement get printed?

Print the time and see if it gets called.
 
Keith Watford:
Then I have nothing to suggest except are you actually removing the indicator from the chart or just changing time-frames or inputs?

I remove indicator. also in my sending code you can see I use "reason == 1". so this part only execute when you close indicator.

also when I debugging my code the pointer show the code is execute, but as you can see have not result.

thank you for helping me and if i find the solution of this problem. send this here too.

 

Please remember that deleting graphic objects in the MQL5 in the OnDeinit() event handler does not always happen immediately. Both the graphical object handling and the de-initialisation event are queued and are not processed immediately. They may take some time to execute, causing the impression that it does not delete graphic objects but if you wait a while they will eventually disappear.

 
Fernando Carreiro:

Please remember that deleting graphic objects in the MQL5 in the OnDeinit() event handler does not always happen immediately. Both the graphical object handling and the de-initialisation event are queued and are not processed immediately. They may take some time to execute, causing the impression that it does not delete graphic objects but if you wait a while they will eventually disappear.

so how much time need to execute and remove?
 
justlink: so how much time need to execute and remove?

Sometimes it may take a few seconds. I have had my charts sometimes take up to 5 seconds before the objects are removed depending on the CPU and RAM load.

 
Fernando Carreiro:

Sometimes it may take a few seconds. I have had my charts sometimes take up to 5 seconds before the objects are removed depending on the CPU and RAM load.

thank you Mr Keith Watford and Mr Fernando Carreiro. I find solution base on your advice and search the entire internet. this is the result:

When we have too many Object in chart, change properties or delete them take few seconds or even minutes base on user hardware or internet connection. So the only solution is limited candle calculate "For" and object draw base on user Input