On this question: "I have a question/suggestion about your recent backtest of the breakout scan. Couldn't you have just inserted a "loop(-10,-10)" at the beginning of the scan, rather than changing each formula's parameters by 10 days? Is this still possible in version 2 of QP?"
The best way to do it in the breakout scan would be to use variables:
//Breakout scan by Richard Estes, translated from TC2000 //and revised by Doug Schneider
Output="breakout.lst"; input="ms.lst"; issuetype=common; exchange nyse,nasdaq,amex; DaysToLoad = 250;
float days;
days:=-10;
If Close(days)<=30 and //price < $30 Close(days)>movavg(days,34,cl) and //price > avg price last 34 days (Max(-4+days,-25+days,hi)/(0.01+Min(-4+days,-25+days,lo)))<1.2 and //prev month max high no more than 20% greater than max low Vol(days) > AvgVol(days,-180+days) and //Vol. today greater than avg. vol. over past 180 days Vol(days) >= 30000 and //Volume today greater than 30000 AvgVol(days,-30+days)>=30000 and //Average volume over the last 30 days is at least 30,000 QRS(days)>=80 and //Relative Strength is greater than 80 percent (Close(days)/(0.01+movavg(days,3,cl)))>1.02 and //price > avg price prev 3 days by at least 2.0% (Close(days)/(0.01+movavg(days,3,cl)))<1.06 then //But not more than 6.0%
println symbol:-6, " BUY: Close: ", close(0):-6:3, ",", " Up: ", close(0)-close(-1):4:3, ","," Volume: ", vol(0):-10, ",", " QRS: ", QRS(0):2, ","," Sharesfloat: ", Sharesfloat:6:3, ","," Persistence: ", Persistence(0):6:3, ", ",Description:-12; endif;
Here's the original:
//Breakout scan by Richard Estes, translated from TC2000 //and revised by Doug Schneider
Output="breakout.lst"; input="commplus.lst"; issuetype=common; exchange nyse,nasdaq,amex; DaysToLoad = 250;
If Close(0)<=30 and //price < $30 Close(0)>movavg(0,34,cl) and //price > avg price last 34 days (Max(-4,-25,hi)/(0.01+Min(-4,-25,lo)))<1.2 and //prev month max high no more than 20% greater than max low Vol(0) > AvgVol(0,-180) and //Vol. today greater than avg. vol. over past 180 days Vol(0) >= 30000 and //Volume today greater than 30000 AvgVol(0,-30 )>=30000 and //Average volume over the last 30 days is at least 30,000 QRS(0)>=80 and //Relative Strength is greater than 80 percent (Close(0)/(0.01+movavg(-1,3,cl)))>1.02 and //price > avg price prev 3 days by at least 2.0% (Close(0)/(0.01+movavg(-1,3,cl)))<1.06 then //But not more than 6.0%
println symbol:-6," BUY: Close: ", close(0):-6:3, ",", " Up: ", close(0)-close(-1):4:3, ","," Volume: ", vol(0):-10, ",", " QRS: ", QRS(0):2, ","," Sharesfloat: ", Sharesfloat:6:3, ","," Persistence: ", Persistence(0):6:3, ", ",Description:-12; endif; |