Indicator with multiple (sub)windows?

 

Hi to all,

simple question: is it possible to create a custom MQL5-indicator with multiple (sub-)windows, with plot lines e.g. in the main chart and in two subwindows (so 3 in all)?

I'm not talking about drawing objects, I'm talking about INDICATOR_DATA.

Thaks

 
Fantiago: simple question: is it possible to create a custom MQL5-indicator with multiple (sub-)windows, with plot lines e.g. in the main chart and in two subwindows (so 3 in all)? I'm not talking about drawing objects, I'm talking about INDICATOR_DATA.

No.

 
Ryan L Johnson #: No.

Ok, thanks. But how about ChartIndicatorAdd(). Looks like a suitable workaround, but couldn't get it to work so far...?

Documentation on MQL5: Chart Operations / ChartIndicatorAdd
Documentation on MQL5: Chart Operations / ChartIndicatorAdd
  • www.mql5.com
Adds an indicator with the specified handle into a specified chart window. Indicator and chart should be generated on the same symbol and time...
 
Fantiago #: But how about ChartIndicatorAdd(). Looks like a suitable workaround, but couldn't get it to work so far...?
That adds separate indicators, each one a separate program, which is not what you asked for.
 
Fantiago #:

Ok, thanks. But how about ChartIndicatorAdd(). Looks like a suitable workaround, but couldn't get it to work so far...?

Please change your avatar immediately. You are not allowed to use MetaQuotes logo this way.

 
Fernando Carreiro #: That adds separate indicators. It is not what you asked for.

I thought maybe I could program an indicator that plots in the main chart and insert ChartIndicatorAdd() twice with the added indicators referring to the first one via iCustom().

Or would this result in a circular reference and thus an error?

 
Fantiago #:

I thought maybe I could program an indicator that plots in the main chart and insert ChartIndicatorAdd() twice with the added indicators referring to the first one via iCustom().

Or would this result in a circular reference and thus an error?

Your original question is regarding "a custom MQL5-indicator." If you're now changing it to multiple indicators, then just code multiple indicators.

 
Fantiago #: I thought maybe I could program an indicator that plots in the main chart and insert ChartIndicatorAdd() twice with the added indicators referring to the first one via iCustom(). Or would this result in a circular reference and thus an error?

iCustom() will create another instance of the indicator and depending on how you code the main one, yes there could be problems.

Also, as @Alain Verleyen requested, please change your avatar (profile image). You are violating the terms and conditions.

 
Fernando Carreiro #:

iCustom() will create another instance of the indicator and depending on how you code the main one, yes there could be problems.

Also, as @Alain Verleyen requested, please change your avatar (profile image). You are violating the terms and conditions.

Ok, I will change it. Thought it a compliment to MetaQuotes.

I tested further and can now tell that ChartIndicatorAdd() and — in that added indicator — iCustom() work well, so this could be a workaround. Just in case anybody wondered :-)

@MetaQuotes: if you're reading this: would be nice to be able to program indicators that can plot both in the main window and subwindow(s) at once. Ok?

 
Fantiago #: @MetaQuotes: if you're reading this: would be nice to be able to program indicators that can plot both in the main window and subwindow(s) at once. Ok?

It has been requested before, several times over the years, but there have been no development in that regard.

 
@Fantiago, you might consider coding an EA to call and add your indicators in separate windows.