Now that you mention it :) I had commented weekly; // okay?, but needed to change the backtest logic; the quick fix which gave the following says weekly; // won't really work :)
I have appended the code -- one problem is whether QP does true weekly, another, which is probably fixable, is that day -19 will test week -19/5 => -3. How would reformulating the weekly test to a daily by ----- set MACD = 60,130,45 and if macd(tbar) > 0 and macd(tbar-5) > macd(tbar-10) and macd(tbar) < macd(tbar-5) then ----- grab you?
Bob
---- symbol,description,30dayvol,hi-2 stoploss,testdate AMCC,APPLIED MICRO CIRCUITS CORP CDT-COM,331476.656,50.75,04/07/1999 CSGS,CSG SYS INTL INC COM,579543.312,45,04/07/1999 NEON,NEW ERA OF NETWORKS INC COM,1007683.31,78.375,04/07/1999 OSTE,OSTEOTECH INC COM,203148.328,36,04/07/1999 VRTS,VERITAS SOFTWARE CO COM,621346.688,90.125,04/07/1999 ---- symbol,description,30dayvol,hi-2 stoploss,testdate PEGS,PEGASUS SYS INC COM,224030,47.25,05/05/1999 PHCC,PRIORITY HEALTHCARE CORP CL B,148021.672,34.5,05/05/1999 RADS,RADIANT SYS INC COM,62573.332,12,05/05/1999 ---- //input="comkey prescan.lst"; integer tbar; tbar := -20; output="elderov-20.lst"; daystoload=250-tbar; daysrequired=250-tbar; printhdrln " symbol,description,30dayvol,hi-2 stoploss,testdate" ; weekly; // won't really work if macd(tbar/5) > 0 and macd(tbar/5-1) > macd(tbar/5-2) and macd(tbar/5) < macd(tbar/5 -1) then daily; set stochastic=8,3,5; if stochasticpctk(tbar-1) > 80 and stochasticpctk(tbar)<80 and cci(tbar) < cci(tbar-1) and close(tbar) > 5.00 and close(tbar) < close(tbar-1) and movavg(tbar-1,30,vol) >= 50000 then println symbol, ",",description,",",movavg(tbar,30,vol),",", high(tbar-1),",",date(tbar); endif;endif; |