Is there a way for an indicator to tell the terminal to stop it and remove it from the chart it was running on?

 

Is there any way to do this, such as maybe the indicator could run a script that kills the indicator somehow, or tells the terminal to do it?

There are times I'd like a logic path to end in "quit" or "KillMe" or something.

 
I believe that ExpertRemove also works.
 
William Roeder #:
I believe that ExpertRemove also works.

Works on indicators?

 
Millard Melnyk:

Is there any way to do this, such as maybe the indicator could run a script that kills the indicator somehow, or tells the terminal to do it?

There are times I'd like a logic path to end in "quit" or "KillMe" or something.

Removes an indicator with a specified name from the specified chart window.
Documentation on MQL5: Chart Operations / ChartIndicatorDelete
Documentation on MQL5: Chart Operations / ChartIndicatorDelete
  • www.mql5.com
Removes an indicator with a specified name from the specified chart window. Parameters chart_id [in]  Chart ID. 0 denotes the current chart...
 

Thank you Alexander! Just what I was looking for. I'll play around with it.

Reason: