//This is above in State.Configure
AddDataSeries("XLRE",BarsPeriodType.Minute,BarsPeriod.Value);
protected override void OnRender(ChartControl chartControl, ChartScale chartScale) {
if (ChartBars.Bars == null || Bars.Instrument == null)return;
base.OnRender(chartControl, chartScale);
for (int idx = ChartBars.FromIndex; idx <= ChartBars.ToIndex; idx++){
//Is this a way to get a unique timestamp from the primary bars object?
DateTime slotTime = chartControl.GetTimeBySlotIndex(idx);
int subIdx = BarsArray[0].GetBar(slotTime);
//pass the time to the second bars array object to see if there is a bar there
if(BarsArray[1].GetClose(subIdx) == null){
Print("XLRE has no data at bar number: " + BarsArray[0].GetTime(subIdx));
}else{
Print(String.Format("XLRE Close is: {0} at time: {1}.", BarsArray[1].GetClose(subIdx), BarsArray[1].GetTime(subIdx)));
}
}
}
Indicator 'CustomRenderTc': Error on calling 'OnRender' method on bar 418: Object reference not set to an instance of an object.

Comment