Download MetaTrader 5
To add comments, please log in or register
Copy the deals of successful traders. Subscribe to signals!
Matej
67
Matej 2010.10.11 21:10 

I was wondering if it's possible for an indicator to remove itself.

Currently I use an indicator to create a label on the chart and update it every tick. But if you want to remove it, you have to first remove the indicator, and also remove the label. I know that in the deinit() function I can put code that will delete the label, but, would it be possible that if the indicator detects that the label no longer exists (user has deleted it), it deinitializes itself?


Thank you.

qjol
3243
qjol 2010.10.11 23:02  

as far as i know Computers can not do anything without telling them how to do & Can do anything if you tell them how to do

Denny Muhammad Zein
1424
Denny Muhammad Zein 2015.06.06 14:02  
Papler:

I was wondering if it's possible for an indicator to remove itself.

Currently I use an indicator to create a label on the chart and update it every tick. But if you want to remove it, you have to first remove the indicator, and also remove the label. I know that in the deinit() function I can put code that will delete the label, but, would it be possible that if the indicator detects that the label no longer exists (user has deleted it), it deinitializes itself?


Thank you.


 Have a look at 

https://docs.mql4.com/objects/ObjectFind

and

https://docs.mql4.com/chart_operations/chartindicatordelete

/
To add comments, please log in or register