Is there a run-time work-around for #property indicator_chart_window / indicator_separate_window?

 

Does anyone know of a trick or work-around that would allow an Indicator to switch or initially select between it appearing on the main chart window or on a separate sub window, programmatically at run-time and not at compile-time?

Normally, this selection occurs at compile-time by the use of pre-processor program properties, namely:

  • #property indicator_chart_window
  • #property indicator_separate_window

I am hoping someone knows a work-around or trick to do this at run-time!

 

The reason I am asking this is that I plan to place one of my indicators on the Market, but I use it both on the chart or as separate sub-window (depending on the situation), even though it is exactly the same Indicator.

However, Market rules prohibit there being two identical products with only minor differences.

 
Fernando Carreiro:

The reason I am asking this is that I plan to place one of my indicators on the Market, but I use it both on the chart or as separate sub-window (depending on the situation), even though it is exactly the same Indicator.

However, Market rules prohibit there being two identical products with only minor differences.

I researched this subject a while ago and follow closely all MT5's changelogs and there is nothing new I think... I gave up... It was just a proof of concept of an indicator that in the end went nowhere... :D

But, if your indicator is named properly (indicator Title) and the description is totally clear, I don't see any problem posting 2 similar products, after all, it has a different feature that is: Running on a Chart, and the other running on a Sub-window.

Right from the top of my head, did you tried to embed a second copy of your indicator through #resource, having this second indicator using the #property indicator_separate_window and then, from the 1st indicator using ChartIndicatorAdd() ?

Cheers!

;)

 
Flavio Jarabeck: Right from the top of my head, did you tried to embed a second copy of your indicator through #resource, having this second indicator using the #property indicator_separate_window and then, from the 1st indicator using ChartIndicatorAdd()?

No, I did not think of that! I will research that possibility to see if it can be applied in my case.

EDIT: Although doing that might make it difficult for it to be used by an EA. I will have to do more research on it!