I am trying to set up a screener which looks at the slope of both the %K and %D lines of the stochastic. Rather than looking at the traditional overbought / oversold values. This is along the lines of the “Anti” set up as described in the book Street Smarts by Connors and Raschke where they use a seven period %K with a smoothing parameter of 4 and a 10 period %D.
I can find stochastic in the proscreener programming guide but can’t see how I can utilise the %K and %D individually.
Help in coding would be appreciated.
Because the stochastic instruction return only %K, you just have to make a moving average of your stochastic indicator which is the %D.
Like this :
K = stochastic[14,3]
D = average[4](K)
RETURN K, D
(this is an indicator), but you can get the K and D value in your screener if you like.
Thank you Nicolas
if I want say the %K today to be greater than %K yesterday and %D today to be less than %D yesterday can I write it like:
%K > %K[1]
%D < %D[1]
Or would it be more like:
K = stochastic(14,3)
D = average(4)(K)
KYday = stochastic[1](14,3)
DYday = average(4)(KYday)
K > KYday
D < DYday
Thanks
No, it’s not so complicated 🙂
You already have in your variable the %D and the %K values, so just compare theses variables between them:
K = stochastic[14,3]
D = average[4](K)
if K>K[1] then
Kresult = 1
else
Kresult = 0
endif
if D<D[1] then
Dresult = 1
else
Dresult = 0
endif
Hi Sydney
Just curious. Do you use the ANTI strategy in your trading? Have you tried to use it in an automatic trading system?