This custom indicator preforms a series of calculations based on the close. When I apply and 8 Renk added series using AddRenko() to a 4 Renko chart, The values don't match a regular 8 Renko chart. Since I was using Close[0] in my code, I assumed it was reading closes from the 4 renko (base chart) instead of the added 8 Renko data series that was using add renko.
I decided to create a Series<double> called dsClose to build a data set of closes on the added data series (8 Renko). When I did this, I started getting index errors like this:
Error on calling 'OnBarUpdate' method on bar 10: 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.
if (BarsInProgress == 1)
{
dsClose[0] = Closes[1][0];
closeCount = closeCount + 1;
Print("CC: " + closeCount.ToString() + " Closes " + dsClose.Count.ToString());
}
Comment