how to remove indicators from a chart...

 

Hello folks, I have an script that when I run it, it add an indicator to a chart.

I want to create another script that when I run it, it remove the indicator on the previous chart. I have tried IndicatorRelease(...) function with the handle of the indicator created previously but no success. I don't know if it is because it is a different script and has no permission or something like that, I don't know.

What mql5 function/code I have to use to achieve that?


Thanks in advance, Cyberglassed.

 
bool  ChartIndicatorDelete(
   long           chart_id,              // chart id
   int            sub_window             // number of the subwindow
   const string   indicator_shortname    // short name of the indicator
   );

https://www.mql5.com/en/docs/chart_operations/chartindicatordelete

I think this code will be useful for you.


Documentation on MQL5: Chart Operations / ChartIndicatorDelete
Documentation on MQL5: Chart Operations / ChartIndicatorDelete
  • www.mql5.com
Chart Operations / ChartIndicatorDelete - Documentation on MQL5
 

to get variable from another chart use this.

https://www.mql5.com/en/docs/globals

if i wrong .Moderator corrects it.
Documentation on MQL5: Global Variables of the Terminal
Documentation on MQL5: Global Variables of the Terminal
  • www.mql5.com
Global Variables of the Terminal - Documentation on MQL5
 
alipoormomen:

to get variable from another chart use this.

https://www.mql5.com/en/docs/globals

if i wrong .Moderator corrects it.
Your first post answers the question. This one has nothing to do with it.
 
angevoyageur:
Your first post answers the question. This one has nothing to do with it.
Thank you, it works! ;)
Reason: