I am trying to add a Print statement to the code below (other Print statements are ok) within the OnMarketDepth method but I am getting an error. Error on calling 'OnMarketDepth' method for indicator 'CumulativeDepth': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
if (bidbookfilled==1 && askbookfilled==1)
{
//Print("OnMarketDepth()");
//Print("Time : " + DateTime.Now.ToLongTimeString());
//Print("Cummulative Depth ASK is " + sum1 + " " + Time[0]);
//Print("Cummulative Depth BID is " + sum2 + " " + Time[0]);
[COLOR=Red] Print(Time[0] + " " + sum2 + " Bids " + bidRows1[0].Volume + " | " + bidRows1[1].Volume + " | " + bidRows1[2].Volume + " | " + bidRows1[3].Volume + " | " + bidRows1[4].Volume);
Print(Time[0] + " " + sum1 + " Asks " + askRows1[0].Volume + " | " + askRows1[1].Volume + " | " + askRows1[2].Volume + " | " + askRows1[3].Volume + " | " + askRows1[4].Volume);[/COLOR]
bidbookfilled=0;
askbookfilled=0;
//Print(Environment.NewLine);
}
suprsnipes

Comment