Indicator lines are not drawn in chart window if zero / Calculation of indicators in the chart window and in a separate window in one indicator

Hello.

I try my best to learn C++ and MQL5. But I have some problems, which you see in the chart below.

Is it possible that the yellow indicator lines are not drawn if the indicator value is zero ? 

Is it possible that i create indicator lines in the chart window and a signal line from 0 to 100 in seperate window and both indicators are calculate in one indicator program ?

Would you be so kind and could give me a hint or an example?

Sincerely,
Ulrich67

Chart

Ulrich67:

Hello.

I try my best to learn C++ and MQL5. But I have some problems, which you see in the chart below.

Is it possible that the yellow indicator lines are not drawn if the indicator value is zero ? 

Is it possible that i create indicator lines in the chart window and a signal line from 0 to 100 in seperate window and both indicators are calculate in one indicator program ?

Would you be so kind and could give me a hint or an example?

Sincerely,
Ulrich67


  1. You have to set a value for all index of the indicator buffer, if you don't want to draw indicator for some bars, then simply affect the EMPTY_VALUE.
  2. No, it's not possible to draw on chart and on a subwindow with the same indicator.