Stochastic %K and %D
Forums › ProRealTime English forum › ProScreener support › Stochastic %K and %D
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by Brage.
-
-
06/03/2016 at 3:08 PM #8753
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.
06/03/2016 at 3:42 PM #8761Because the stochastic instruction return only %K, you just have to make a moving average of your stochastic indicator which is the %D.
Like this :
1234K = 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.
06/04/2016 at 4:18 AM #8784Thank 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:
12%K > %K[1]%D < %D[1]Or would it be more like:
123456K = stochastic(14,3)D = average(4)(K)KYday = stochastic[1](14,3)DYday = average(4)(KYday)K > KYdayD < DYdayThanks
06/05/2016 at 10:24 AM #8816No, it’s not so complicated 🙂
You already have in your variable the %D and the %K values, so just compare theses variables between them:
1234567891011121314K = stochastic[14,3]D = average[4](K)if K>K[1] thenKresult = 1elseKresult = 0endifif D<D[1] thenDresult = 1elseDresult = 0endif06/05/2016 at 10:36 AM #881701/07/2017 at 3:34 PM #20120 -
AuthorPosts