I have a crack spread indicator the uses CL, RB, HO contracts that runs fine on a daily chart, however when I port the indicator to an intraday chart, say 15 min bars, the RB contract does not load and throws a Index out of range error, (see attached file). This happens ONLY for RB. HO contract has no problem, so when I change the order of the AddSeries, the Series that causes the error is always RB.
Here is the code I use to add the series:
AddDataSeries("RB 09-16",Data.BarsPeriodType.Minute, 15,Data.MarketDataType.Last); AddDataSeries("HO 09-16",Data.BarsPeriodType.Minute, 15,Data.MarketDataType.Last);
Spread[0] = ((42*(RBcontracts*Closes[1][0] + HOcontracts*Closes[2][0]) - CLcontracts*Closes[0][0]) / Math.Max(1,CLcontracts));
Thanks in advance.
Comment