int range=200;
for(int i=0; i<range; i++){
if(SMA(1)[i]>techo){ //calculo techo con RANGO=X
techo=SMA(1)[i];
}
if(SMA(1)[i]<suelo){ //calculo suelo con RANGO=X
suelo=SMA(1)[i];
}
}
My thinking was iterating a few bars before and store the max an min value. I don't know if there's a function that already does that, I didn't see anything in the documentation, if not how can i get rid off this error? Why is there a restriction in range when in the chart I have plenty off bars to get info from?

Comment