Download MetaTrader 5

How to Toggle Indicators On and Off

To add comments, please log in or register
Anamorphic
124
Anamorphic  

HI

I would like to be able to toggle some/all of the indicators on and off when viewing the chart, is this possible ?

Thanks

N

qjol
3243
qjol  

you can choose not to show on a specific TF



or you can use a script to remove it ChartIndicatorDelete

rod178
272
rod178  
Anamorphic:

HI

I would like to be able to toggle some/all of the indicators on and off when viewing the chart, is this possible ?

Thanks

N


Use (Terminal) Global Variables in each indicator that you desire to toggle on and off

The toggles can be set via scripts of buttons etc

//Toggle Script
int     value;
string  ToggleScript = "ToggleScript"; 

int OnStart()
{ 
   if(MathRound(GlobalVariableGet(ToggleScript))==0) value=1;
   else value=0;
   GlobalVariableSet(ToggleScript,value);
   Print("Toggle is  ",value);   
}
Alain Verleyen
Moderator
32062
Alain Verleyen  
Anamorphic:

HI

I would like to be able to toggle some/all of the indicators on and off when viewing the chart, is this possible ?

Thanks

N

Simply said it's not possible. Best thing to do is to use templates.
rod178
272
rod178  
angevoyageur:
Simply said it's not possible. Best thing to do is to use templates.

It is possible to toggle on and off Custom indicators

Alain Verleyen
Moderator
32062
Alain Verleyen  
rod178:

It is possible to toggle on and off Custom indicators

Modifying the code of each indicators is not a solution in my opinion. And what can be the advantage to use a GlobalVariable compared to templates ?

Keep it simple.

rod178
272
rod178  
angevoyageur:

Modifying the code of each indicators is not a solution in my opinion. And what can be the advantage to use a GlobalVariable compared to templates ?

Keep it simple.



I use Templates for such requirements, although sometimes I merely desire to remove one custom indicator from a chart.

I such cases I use a hotkey to toggle a script that sets a variable to 0 or 1

simple matter to place

if(toggle==0) // then "find and delete indicator objects and return(0)"

so the script still runs, although is is interrupted.

Reason is that in some cases multiple templates can be difficult to manage/maintain.

Anamorphic
124
Anamorphic  

That's a shame, I thought i could do it with templates but if i have specific analysis elements for example; lines or arrows etc.. they would need to be created in each chart exactly so, too time consuming to be of use.

The way I would hope it could work is in layers so that I can turn on an off the elements that I need.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
Have a button and then assigned it so that once click will hide the indi and click again will show the indi. I do it and works pretty well.
Alain Verleyen
Moderator
32062
Alain Verleyen  
Anamorphic:

That's a shame, I thought i could do it with templates but if i have specific analysis elements for example; lines or arrows etc.. they would need to be created in each chart exactly so, too time consuming to be of use.

The way I would hope it could work is in layers so that I can turn on an off the elements that I need.

Ctrl+I then Delete the unneeded indicator(s). Place your usual indicator(s) in Favorites, then simply drag it to a chart when needed.
To add comments, please log in or register