Indicator Scale Issue - Indicator not scaling properly

 

Hello,

I have the traditionnal MACD indicator however, it does not want to scale properly.

It scales the signal and MACD but not the histogram.

So what happens is that the histogram will at times not be scalled properly in the window. But the signal line with MACD line is always scaled.

As an example, say MACD is under the zero line and has been for the whole bars that I can see on my chart, then I won't be able to see the positive histogram since it would be out of the scale and not within the indicator window.

So the question is, how do I make the indicator scaling properties take into consideration the histogram as well, so it doesn't only scale properly the MACD and signal line but the histogram too.

I tried to set MAX and MIN values for the scale but as you may know, depending on the data, it will show differently. So this is not a fix.

Basically, what I've done is take the original MACD indicator on MT5 and modified it so the MACD shows as line and not histogram. Then I simply added a new indicator plot for the histogram and made it so the value of the histogram is MACD - Signal. But now, the histogram value is not taken into consideration when scaling the indicator in the window. Therefore, it doesn't always fully show the histogram.

Could anyone please suggest what I could do to fix the issue?

I am new to MQL5 coding.

Thanks in advance!

Reason: