Hello, i read about the problem with PRT Engine and for in for loops. I have the following indicator and want to run it in my ProScreener. Problem: i get the infinite loop error. How can i solve this? DEFPARAM CALCULATEONLASTBARS = 500 timeRange=200 result=0 searchLeftOffset1=5 searchLeftOffset2=20 //check if actual close is near highest close in timeRange if close > 0.97*highest[timeRange](close) AND close < 1.02*highest[timeRange](close) then //if so, search for next close within timerange, that meets the same criteria. Start search searchLeftOffset1 Days before for z = searchLeftOffset1 to timeRange do if close[z] > 0.96*highest[timeRange](close) AND close[z] < 1.02*highest[timeRange](close) then //if second day found, search for next close within timerange, that meets the same criteria. Start search searchLeftOffset2 Days before for y = z + searchLeftOffset2 to (timeRange) do if close[y] > 0.96*highest[timeRange](close) AND close[y] < 1.02*highest[timeRange](close) then result=1 endif next endif next else result=0 endif return result Thank you Best regards, Branimir