![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a custom indicator that has two buffers, one is histograms, the other is a line. The line is a 6 period average of the histogram values.
When I drop the indicator on the chart, everything is ok.
When I go to the property sheet and click ok, OR, when I change periodicities, the history of the line disappears and the line only is drawn from bar 1 to bar 0. The histograms are still visible. Here is how the line is calculated:
// SignalValue and SignalAvg are buffers
SignalValue[iCurBar]=myValue;
SignalAvg[iCurBar]=iMAOnArray(SignalValue,0,periodsToAverage,0,MODE_SMA,iCurBar);
The code is in a for loop in the start() code that iterates the bars from highest down to zero.
Any tips or help is greatly appreciated. I'm stuck on this one.
Thanks,
Christian