Here dist is a variable but inside the for loop its used as an array in afl programming
dist = 1.5*ATR(10);
for(i = 0;i < BarCount; i++ ) {