e not d in if close(e) gives lots of output.
// ---- WhenMinMax scan Input = "300k.lst"; Output = "WhenMaxMin.lst"; Integer d, e, mindate, maxdate; Float maxbar, minbar; for d = -20 to -2 step 1 do if cci(d) < -100 and cci(d) > -999999.00 and cci(d) > cci(d-1) then maxbar := max(0, d+2, cl); minbar := min(0, d+2, cl); mindate := d; maxdate := d; for e = d to 0 step 1 do if close(e) >= maxbar then // not d maxdate := e; e := 0; endif; if close(e) <= minbar then // not d mindate := e; e := 0; endif; next e; println symbol, ",", date(d), ",", d, ",", open(d+1):8:2, ",", date(maxdate), ",", max(0,d+2,cl), ",", maxbar, ",", max(0,d+2,cl)/open(d+1):5:2, ",", date(mindate), ",", minbar,",", min(0,d+2,cl), ",", min(0,d+2,cl)/open(d+1):5:2; endif; next d; // --- end WhenMinMax scan
|