This is a single criteria that seems to help- High Average True range. Authorship should extend to Mr. Jagow.
output = "atr89.lst"; issuetype common; ProcessMS = "c:\msdata\atr89\",MSDATA; float cl, ATR89, tr,MA89Cl; integer bar, testbar; testbar:= 0; // testbar:= -30; would give ATR89 30 days ago DaysToLoad = 91-testbar; DaysRequired = 91-testbar;
if close(testbar) >4.99 then if movavg(testbar,34,vol)>250000 then if qtrrev(0) > qtrrev(-4) then ATR89:= 0; // initially set it to zero for each symbol for bar = testbar-88 to testbar do // 89 values; don't need to specify step 1 because it is the default cl:= close(bar-1); // close(-88) to start tr:= range(bar); // the usual case, no gap if cl > high(bar) then //down tr:= cl - low(bar); else if cl < low(bar) then //up tr:= high(bar) - cl; endif;endif; ATR89:= ATR89 + tr; // add tr to previous value next bar; ATR89:= ATR89/89; // divide the sum by 89 MA89Cl:=movavg(testbar,89,cl); if ATR89/MA89Cl*100>5.5 then println symbol,",",date(testbar),",",ATR89/MA89Cl*100:6:2,",",qtrrev(0),",",qtrrev(-4); endif;endif;endif;endif; |