How do I draw MACD in the sub windows from code (MQL4) - page 2

 
s050399b:
is there a search function on the forum? i couldn't find it
 
s050399b:

https://docs.mql4.com/chart_operations

 

Is there a way to Close a sub window?

 

I am calling MACD from my indicator, and when I remove the MACD indicator, it will remove my indicator too.

 I need my indicator to be running, just remove the MACD indicator or remove the sub window 

Totally unclear, what is your problem finally ?
 
Alain Verleyen:
Totally unclear, what is your problem finally ?

In my chart, I wanted to press "w" to launch MACD in a sub window.

And then press "w" again to close the subwindow.

 

I have an indicator, called "Lines", launching the MACD indicator; in meta editor, there's mq4 code files for MACD.

 

 

 Problem

1) subwindow is created from the start; I want to  launch the subwindow when "w" is pressed

2) when I hit "w", it will remove the subwindow with the MACD, and my indicator "Lines" - it should only remove the subwindow and leave my indicator "Lines" alone. 

 
in short, I need help to toggle MACD on my chart; I have lines in the my chart - can't use the template for that.
 

Only if you hard code the entire indicator into your expert.

It is still a mystery to me why you want.

 
Marco vd Heijden:

Only if you hard code the entire indicator into your expert.

It is still a mystery to me why you want.

I have the entire MACD code in my indicator.

problem:

it will launch subwindow immediately instead of when i call it

when i remove the MACD in my indicator, it removes my indicator as well

 

 

 

 a quick check if there's MACD divergence

 

Visual check or code wise ?

Those are two different things.

 
Marco vd Heijden:

Visual check or code wise ?

Those are two different things.

visual check

 

yea so you can call the indicator from the expert but it will not be visible on your chart.

if you want to, it is possible but you have to incorporate the indicator into the ea itself this means you are not calling the indicator anymore,

but you hard code it's visual output into the ea itself, which is a lot of work to do.

So it's your decision you either load and remove it manually or take the time to code it.

 
Marco vd Heijden:

yea so you can call the indicator from the expert but it will not be visible on your chart.

if you want to, it is possible but you have to incorporate the indicator into the ea itself this means you are not calling the indicator anymore,

but you hard code it's visual output into the ea itself, which is a lot of work to do.

So it's your decision you either load and remove it manually or take the time to code it.

i want to integrate it, do u know how to create a subwindow and close one on demand

Reason: