input int InpDepth=12; // Depth
input int InpDeviation=5; // Deviation
input int InpBackstep=3; // Backstep
double zz_value;
for(int z = 0;z<Bars;z++) {
zz_value = iCustom(NULL,0,"ZigZag",InpDepth,InpDeviation,InpBackstep,0,z);
if(zz_value!= EMPTY_VALUE)
break;
}
ObjectCreate(0,"zz_line",OBJ_HLINE,0,0,zz_value);