One more thing for the scan output, per Mike Artobello's original scan:
//Calculate percent of volume change compared to 50 average daily volume
vi := ((Vol(0) - AvgVol(0,-50)) / AvgVol(0,-50)) * 100;
So the whole thing again is:
//Canslim scan by Mike Artobello, //translated for QP2 by Brooke
output ="canslim.lst"; input="commplus.lst"; issuetype=common; exchange nyse,nasdaq,amex;
daystoload=300;
integer i, j, k;
float ma, mb, mc, pwh, vi;
//10-day MA has been above the 50-day MA every week for the past 3 months ma:=0; for i = 0 to -60 step -5 do if movavg(i,10,Cl)>movavg(i,50,Cl) then ma:=i; endif; next i;
//50-day MA has been rising every week for the past 3 months mb:=0; for j = 0 to -60 step -5 do if movavg(i,50,Cl)>movavg(i-5,50,Cl) then mb:=j; endif; next j;
//Low within 15% of 52 week high every day for 3 months mc:=0; for k = 0 to -60 step -1 do if low(k)>=.85*max(0,-250,hi) then mc:=k; endif; next k;
//Calculate percent within 52 week high pwh:= ((Close(0)- Max(0,-250,hi))/Max(0,-250,hi))*100;
//Calculate percent of volume change compared to 50 average daily volume vi := ((Vol(0) - AvgVol(0,-50)) / AvgVol(0,-50)) * 100;
if close(0)>=10 and //Close >= $10 AvgVol(0,-50) !=0 and //Prevents division by 0 eps>0 and //Earnings per share > 0 qrs(0)>=80 and //Relative Strength >= 80 avgvol(0,-29)>30000 and //Average daily volume > 30,000 close(0) >= .85*max(0,-250,hi) and //Close within 15% of 52 week high ma=-60 and mb=-60 and mc=-60 then println symbol, ", ","EPS: ",EPS:4:3, ", ","QRS ", QRS(0),", ", "Close: ",Close(0):6:3, ", ", "52 HIGH: ", Max(-1,-260,hi):5:3,", ", "PWH: ",pwh:3:0, ", ","VOL: ",vol(0):7:0, ", ", "AVG VOL: ",avgvol(0,-50 ):7:0, ", ","VOL PCT CHANGE: ",vi:4:0; endif; |