Happy New Year!
I am working on trying to get Bollinger bands (Upper and Lower) to plot inside a custom indicator.
I created the AddPlot
AddPlot(Brushes.Transparent, "Upper VB");
AddPlot(Brushes.Transparent, "Lower VB");
and then I am trying to call on the Bollinger indicator in the OnBarUpdate
protected override void OnBarUpdate()
{
if (ShowVB == true)
{
Values[1][0] = Bollinger(NumStdDev,HiWay).Upper[0];
Plots[0].Brush = (UpperColor);
Values[2][0] = Bollinger(NumStdDev,HiWay).Lower[0];
Plots[0].Brush = (LowerColor);
}
}
The Bands plot but are way off the top and bottom of the chart.
Is there something I'm missing here? I was thinking it would be pretty simple to add.
Thank you for any help with this.
Regards,
James

Comment