how match data we can get from iCustom?

 

Dear Every One

I am using the function "iCustom"  to got data from zigzag .

code like this

tempDoule=iCustom(sym,period,"ZigZag",12,5,3,0,index);

in order to get more data I input some data to history data.

while I increase the int index to 30000 the script stopped with out error alert like "array out of range" .

it's just stopped .

and the max index is different from symbol to symbol .

I had tried "ArraySize"  but there is no array to get the size.

could any one tell me how to get the Max index. so that I could avoid the stop error.

 
Max=iBars(Symbol(),PERIOD_CURRENT)-1;
 
Bars-1