Getting a error saying positive integer expected with lowest. //P1 = 10 //P2 = 100 Dindex = ((exponentialaverage[P1](close)-exponentialaverage[P2](close))/exponentialaverage[P2](close))*100 IF DINDEX CROSSES OVER 0 THEN FLAG1 = BARINDEX ENDIF IF DINDEX CROSSES UNDER 0 THEN FLAG1 = 0 ENDIF IF DINDEX => 0 THEN A1 = HIGHEST[BARINDEX-FLAG1](DINDEX) ELSE A1 = 0 ENDIF a20 = barindex-flag1 flag2 = 0 for a = 0 to a20-1 if dindex[a] = a1 then flag2 = barindex[a] break endif next IF DINDEX => 0 THEN //A1AA = MAX(0,DINDEX) A1A = LOWEST[BARINDEX-FLAG2](DINDEX) ELSE A1A = 0 ENDIF stochlow = LOWEST[BARINDEX-FLAG2](DINDEX) stochhigh = HIGHEST[BARINDEX-FLAG1](DINDEX) stochbuy= max(0,((dindex-stochlow)/(stochhigh+stochlow))*100) RETURN stochbuy I dont understand the problem can someone help me please Thankyou