I'm calling indicators into another indicator. Some are built-in, some are custom.
in the top end, I have the following:
//variables private SMA sma;
protected override void OnStateChange()
{...other stuff
if (State == State.SetDefaults)
{... other stuff
}
else if (State == State.DataLoaded)
{
sma = SMA(20);
}
}
//OnBarUpdate section... double smaValue = (SMA(20).Value.IsValidDataPoint(0)) ? SMA(20).Value[0] : 0;//Input[0]; //similar for custom indicators...
//error messages from log: //Strategy Strategy 'kzCongestion100newstart': Error on calling 'EventHandlerBarsUpdate' method: Object reference not set to an instance of an object. //Indicator called into strategy Indicator 'kzChartGridv04': Error on calling 'OnBarUpdate' method on bar 29: Object reference not set to an instance of an object. //sub Indicator called into Indicator Indicator 'ConnorsRSIv01': Error on calling 'OnBarUpdate' method on bar 31: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

Comment