I will preface this question with the statement that I have no idea what I'm doing!
I'm attempting to expand the stock Volume Zones indicator to display volume for each tick.
I've, essentially, copied the stock Volume Zones indicator into a new script and changed the name. I've changed two variables as such:
int volumeBarCount = BarCount;
to
int volumeBarCount = Convert.ToInt32(priceRange/TickSize);
and
double priceBoxSize = priceRange / volumeBarCount;
to
double priceBoxSize = TickSize;
I repositioned the volumebarcount line to under the pricerange. The script compiles. I get nothing on the chart. Shock, horror.
I added a print command in the //Pass 2 rectangle rendering loop, one line:
Print("Price: " + priceLower + " Volume: " + volumeMax);
to see if it works.
In the output window, I get this message and nothing else:
Indicator 'Volume Zones Tick': Error on calling 'OnRender' method on bar 3128: Index was outside the bounds of the array.
I have no idea what this means. Am I trying to plot too much data on the screen? What can I do to make it work?
Cheers,
Dan.
Comment