Can't display array values (array out of range), as single variables they work (solved)


I am trying to do some statistics EA with ZigZag. I would like to calculate the mean, variancy, skewness and curtosis of the differences between ZigZag Extrema. Prices as well as time.

It serves an approach to find out how often big movements occur and how big the movements are.

Problem is it seems I can't use all Arrays.

I created a PlotResult array with only the Extrema prices of ZZ and a PlotIndex array to display the number of bars (time, roughly) from bar zero with Arrays set as TimeSeries.

Then the differences of Extrema prices and Extrema times were taken and put in two more arrays, TimeDist and PriceDist.

I work with Comments a lot to see what happens in the arrays. But I can only display the first two via the Comment function, not the latter. Then it says array out of range (150,63). Strangely the array sizes of all four arrays can be displayed correctly in the Comment function.

The irony is if I manually introduce variables g.e. timedist0, timedist1, timedist2 and put the Array values on them I can suddenly display them via Comment...

Am I missing something or is there a limit of functions that an Array can be in? Has anybody ever encountered this problem?

Edit: I can also print the values directly from the array. So I guess this a limitation of the comment function again... but is it a concern for other functions too?

Edit2: So the problem was that inside the OnTick function I had the Comment function above the Probability function and it seems therefore couldn't access it. Thanks guys you are great ^^