My usual goof, Rashid. Max(0,-1,cl) looks at two days; I correctly adjusted start in the if statement, but ---- start := -130; if daysloaded < 130 then start := 1 -daysloaded; endif; ---- will die with your syntax error if a stock has only 130 days; Best way to deal with it is --- issuetype common; output = "myrange.lst"; float maxpr, minpr, max2min; integer start, startmax; daysrequired = 1; startmax := -130; // set what you want here **** start := 1 -daysloaded; if start < startmax then start:= startmax; endif; max2min := 2.50; maxpr:=max(0,start,cl); minpr:=min(0,start,cl); if maxpr > max2min*minpr then println symbol,",",maxpr/minpr:6:2,",",date(0),",",daysloaded,",",start; endif; ------------------- Bob |