Since you didn’t specify…
There are built-in formulas in AB for these values, STOCHK
and STOCHD
More details
from Investor/RT on the Stochastic
formula.
The Formula . . .
Raw %K = 100 * [CL - MIN(LO, n)] / [MAX(HI, n) - MIN(LO, n)]
n = Raw K Period
Fast %D = MA(Raw K, MA Type, Fast D Period)
Slow %D = MA(Fast D, MA Type, Slow D Period)
Note: "Raw %K" is
commonly referred to in other programs as simply "%K". "Fast %D" is
commonly referred to as simply "%D",
or sometimes even "Slow %K".
"Slow %D"
is also referred to as "%DSlow".
Here is the AFL for stochastic as applied to the RSI, resulting in
the Stochastic RSI or SRSI
/* StochRSI %K Calculations (SRSI) */
SRSI_Period = 14; //Adjust to suit
SRSI = (RSI(SRSI_Period) - LLV(RSI(SRSI_Period),SRSI_Period))/
(HHV(RSI(SRSI_Period),SRSI_Period)
- LLV(RSI(SRSI_Period),SRSI_Period));
--
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Mark Keitel
Sent: Thursday, July
07, 2005 15:22
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Stochastic
Can someone point me in
the right direction of just write the afl for this down here for me?
I looked online in the
archives but all of them are not the simple Stochastic %D
Some how I messed up my
Stochastic %D and now it is all messed up
I have way to many lines
and I was just trying to overlay one stochastic over another and some how I got
the formulas all screwed up
Thank you for your help
Please
note that this group is for discussion between users only.
To get support from AmiBroker please send an
e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
---- LSpots keywords ?>---- HM ADS ?>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
---- LSpots keywords ?>
---- HM ADS ?>
YAHOO! GROUPS LINKS