I see function WindowIsVisible(int idx) but is there any way to do: WindowSetVisible(int idx, bool true/false) ??

 

I have in mind a script to drag onto a chart with indicators that will simply toggle the

visibility of those same indicator(s). It is easy enough to get a WindowsTotal() count,

and then for each window, check "WindowIsVisible(idx)". However, AFAIK, there is

no "WindowSetVisible(idx, true/false)" to change the indicator visibility.


Why would this be helpful? Because setting up a handful of indicators on a chart

with the proper size of each is a tedious chore of dragging each subwindow size up

or down. Very often, I have the price chart plus 4 indicator windows. Sometimes

I just want to see price by itself, but other times, I want to see price plus my 4

indicators. I CAN'T use a chart "template" for this purpose because on my price

chart, I am drawing trendlines, fibs, and other objects that I don't want to lose!

Yes, manually I can delete each window, and manually I can add each one back

and resize them but what a pain.


A simple solution for what I want would be possible if only there was some

program control over each subwindow's visibility property! (Am I missing

some existing functionality?)


Possible script: ToggleIndicatorVisibility.mq4

[CODE]

//+------------------------------------------------------------------+

//| script program start function |

//+------------------------------------------------------------------+

int start()

{

for (int idx=1; idx<WindowsTotal(); idx++)

{

if (WindowIsVisible(idx)) WindowSetVisible(idx,false);

else WindowSetVisible(idx,true);

}

return(0);

}

//+------------------------------------------------------------------+

[/CODE]



A new function, "WindowSetVisible(int indx, bool true/false)" would be helpful, however, if

possible, it would be even better to allow control over the buttons for each timeframe

the indicator is visible on. (e.g. M1, M5, M15, M30, H1, H4, Daily, Weekly, Monthly


Is there any way a script can affect these properties which the user can already set

manually, using the various menus ?


Thanks in advance,

Pips4life


 

looks like the only way is to change the property inside the indicators itself.

an EA which is attached to a chart and running, is relaunched after a new compile.

i think this is also the case for indicators, but not sure at the moment.

so the way would be, recompile the inidcators with property set to invisible (dont found the correct syntax)

this all can be done with simple batch scripts.

one for visibility on, one for visibility off

i hope you have got my idea.