I'm currently converting an NT7 Indi to NT8. While loading the Indi into the chart, i'm getting the following error:
Error on calling OnBarUpdate method on bar 0: Object reference not set to an instance of an object.
The code block causing the issue must reside within this section however it's so difficult to figure that out because NT8 doesn't have an appropriated debugging mechansim for Indis.
protected override void OnBarUpdate()
{
if (CurrentBars[0] == 0)
{
displacement = Math.Max(Displacement, -CurrentBar);
priorUpTrend = true;
currentUpTrend = true;
upTrend[0] = true;
PlotStopDot[0] = Close[0];
PlotStopLine[0] = Close[0];
PlotBrushes[0][-displacement] = Brushes.Transparent;
PlotBrushes[1][-displacement] = Brushes.Transparent;
return;
}
Thanks for your help.
Comment