Here are two QP2 stochastics scans, translated from Andy Gabor's formulations for Window on Wall Street. One is Andy's stochastics (55,21,5) system, and the other is Jack Landis' weighted stochastics system.
//Stochastics (55,21,5) by Andy Gabor, //roughly translated for QP by Brooke. Andy uses weighted stochastics.
output="stochast.lst"; input="ibd.lst";
DaysToLoad=100;
Set Stochastic = 55,21,5;
if StochasticPctK(0) > StochasticPctK(-1) and StochasticPctK(0)<75 and StochasticPctK(0)>20 then println Symbol:-3,"BUY , Close: ":-3,Close(0):7:3,"," , " StochasticPctK(0)", ",", StochasticPctK(0):7:3; endif;
if StochasticPctK(0)<75 and StochasticPctK(-1)>75 then println Symbol:-3,"SELL , Close: ":-3,Close(0):7:3,"," , " StochasticPctK(0)", ",", StochasticPctK(0):7:3; endif;
*********
Andy's WOW formulation his (55,21,5) system is:
Enter: mov(stoch(55,21),5,w)> ref(mov(stoch(55,21),5,w),-1) and mov(stoch(55,21),5,w)< 75 and mov(stoch(55,21),5,w) >20
Exit: (mov(stoch(55,21),5,w) <75 and ref(mov(stoch(55,21),5,w),-1) >75)
************
Here's my QP translation of Andy's formulation of Jack's weighted stochastics system:
//Weighted Stochastics, by Jack Landis //translated to Window on Wall Street by Andy Gabor //translated to QP by Brooke Elise Nagler
output="stochas.lst"; input="ibd.lst";
DaysToLoad=150;
float a, b, c, d, e, wstocha, aa, bb, cc, dd, ee, wstochb;
Set Stochastic = 89,21,5;
a := .43*StochasticPctK(0);
Set Stochastic = 55,13,5;
b := .26*StochasticPctK(0);
Set Stochastic = 34,8,5;
c := .16*StochasticPctK(0);
Set Stochastic = 21,5,5;
d := .10*StochasticPctK(0);
Set Stochastic = 8,3,5;
e := .05*StochasticPctK(0);
wstocha := a+b+c+d+e; //This is the weighted stochastic total
Set Stochastic = 89,21,5;
aa := .43*StochasticPctK(-1);
Set Stochastic = 55,13,5;
bb := .26*StochasticPctK(-1);
Set Stochastic = 34,8,5;
cc := .16*StochasticPctK(-1);
Set Stochastic = 21,5,5;
dd := .10*StochasticPctK(-1);
Set Stochastic = 8,3,5;
ee := .05*StochasticPctK(-1);
wstochb := aa+bb+cc+dd+ee; //This is the previous day's weighted stochastic
if wstocha > wstochb and wstocha > 12 then println Symbol:-3,"BUY , Close: ":-3,Close(0):7:3,"," , " Weighted stochastic", ",", wstocha:7:3; endif;
//Alternate buy signal (with "and wstochb<12") -- for fewer signals //if wstocha > wstochb and //wstocha > 12 and //wstochb < 12 then //println Symbol:-3,"BUY , Close: ":-3,Close(0):7:3,"," , " Weighted stochastic", ",", wstocha:7:3; //endif;
if wstocha < wstochb and wstocha < 88 and wstochb > 88 then println Symbol:-3,"SELL , Close: ":-3,Close(0):7:3,"," , " Weighted stochastic", ",", wstocha:7:3; endif;
*********
Andy's WOW formulation of Jack's system is:
Wtd. Stochastics: Enter: .43*stoch(89, 21) +.26*stoch(55,13) +.16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3) > ref(.43*stoch(89,21) +.26*stoch(55,13)+ .16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3),-1) and .43*stoch(89, 21) +.26*stoch(55,13) +.16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3) > 12 Exit: .43*stoch(89, 21) +.26*stoch(55,13) +.16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3) < ref(.43*stoch(89,21) +.26*stoch(55,13)+ .16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3),-1) and .43*stoch(89, 21) +.26*stoch(55,13) +.16*stoch(34,8) +.10*stoch(21,5) +.05*stoch(8,3) < 88
**********
Note that I added one thing to Jack's system in the alternate buy signal:
//if wstocha > wstochb and //wstocha > 12 and //wstochb < 12 then
Andy's translation doesn't specify that the previous day's weighted stochastic was less than 12. You get a lot of buy signals if it isn't in there. By adding "wstochb < 12," the signal is given only when the weighted stochastic has just risen over 12.
Try out the scans, and let me know of any corrections, improvements, etc.
Brooke |