volatility is very important- All my studies say that higher volatility stocks move more on a signal. Use this as an input file- and see how it works: Most of this is derived from work by - of course- Bob Jagow I changed it to 89 days from 21- Play around with the if values on the ATR ratio- also play around with revenue growth which I have remmed out below.
This is the most important thing I learned this year--- oh except for relearning " the trend is your friend":
output = "atr89.lst"; issuetype common; ProcessMS = "c:\meta\atr89\",VMS; 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) > 1.15*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; |