In QP2, you can set the Stochastic MA's like this:
Set Stochastic = 89,21,5;
I did that in this scan:
//Weighted Stochastics, by Jack Landis //translated to Window on Wall Street by Andy Gabor //translated to QP by Brooke
output="wstochas.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;
Set Stochastic = 89,21,5; //This is the weighted stochastic total
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 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; |