Download MetaTrader 5

how to remove indicators from a chart...

To add comments, please log in or register
cyberglassed
611
cyberglassed 2013.08.17 03:07 

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.

Ali Poormomen
1708
Ali Poormomen 2013.08.17 04:37  
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
Ali Poormomen
1708
Ali Poormomen 2013.08.17 04:38  

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
Alain Verleyen
Moderator
31085
Alain Verleyen 2013.08.17 11:07  
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.
cyberglassed
611
cyberglassed 2013.08.17 16:21  
angevoyageur:
Your first post answers the question. This one has nothing to do with it.
Thank you, it works! ;)
To add comments, please log in or register