Stochastic %K and %D
- This topic has 6 replies, 3 voices, and was last updated 8 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProScreener support › Stochastic %K and %D
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 :
1 2 3 4 |
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:
1 2 |
%K > %K[1] %D < %D[1] |
Or would it be more like:
1 2 3 4 5 6 |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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 |
Find exclusive trading pro-tools on