One indicator for chart window and separate window?

 
Is it possible to have one indicator draw simultaneously in chart window and in separate window?
 
enivid:
Is it possible to have one indicator draw simultaneously in chart window and in separate window?

Hi enivid,

Nope, That's why at the beginning of the code we must specify the the display property

#property indicator_chart_window
#property indicator_separate_window

If we specify both of them, the CI will be displayed on main chart and not on separate chart.

However we can create many objects to main chart from separate chart CI, for example drawing divergence lines on main chart. 

:D 

 
onewithzachy:

Hi enivid,

Nope, That's why at the beginning of the code we must specify the the display property

If we specify both of them, the CI will be displayed on main chart and not on separate chart.

However we can create many objects to main chart from separate chart CI, for example drawing divergence lines on main chart. 

:D 

 

answer is no and explanation is at https://www.mql5.com/en/docs/customind/propertiesandfunctions (at bottom)
Documentation on MQL5: Custom Indicators / Connection between Indicator Properties and Functions
Documentation on MQL5: Custom Indicators / Connection between Indicator Properties and Functions
  • www.mql5.com
Custom Indicators / Connection between Indicator Properties and Functions - Reference on algorithmic/automated trading language for MetaTrader 5
 
Andrei Moraru:
Is it possible to have one indicator draw simultaneously in chart window and in separate window?
It is possible, but depends on what the indicator.
 

Here. Draw not in once but cange to #property indicator_chart_window

and he will draws on main chart. 

Files:
 
Andrei Moraru:
Is it possible to have one indicator draw simultaneously in chart window and in separate window?
It's possible, the main indicators are separate windows,
and the second indicator in the main chart window draw with ObjectCreate.
I made like this on my indicator PricePercentRange MT4 and MT5.
 
Roberto Jacobs:
It's possible, the main indicators are separate windows,
and the second indicator in the main chart window draw with ObjectCreate.
I made like this on my indicator PricePercentRange MT4 and MT5.

Hello,
Is it possible with buffers (not ObjectCreate) ?

 
Thierry Ramaniraka: Is it possible with buffers (not ObjectCreate) ?

No. Buffers go to the specified window (separate.)

 

Changes in Buffer arrays  will send indicator output to the window specified at the beginning

#property indicator_chart_window

But other objects can draw to any window at any time 

ObjectCreate(id, OBJ_LABEL,WindowFind("indicator1"),Time[0],0);
Reason: