PureBytes Links
Trading Reference Links
|
Hello,
Indeed there is some mess in literature about
stochastics.
I will describe the way the stochastic functions
are calculated in AmiBroker.
Please note that StochK and StochD in AFL are "Slow
stochastics" they differ
from "Fast stochastic" in that they are
smoothed.
So fast stochastic is calculated as
follows:
FASTSTOCHK = <FONT
color=#ff00ff>100*(C-<FONT
color=#0000ff>LLV(L,<FONT
color=#ff00ff>14))/(HHV(<FONT
color=#000000>H,14)-<FONT
color=#0000ff>LLV(L,<FONT
color=#ff00ff>14));
This is so called Fast Stochastic %K line. Note that
there is no direct function in AFL for calculating fast stochastics.
When we smooth the above function with period 3 MA we
get Fast stochastic %D
FASTSTOCHD = MA( FastStochK, 3
);
Then we arrive at "slow stochastics" -
Slow Stochastic %K is THE SAME as Fast stochastic
%D:
SLOWSTOCHK = MA( FastStochK, 3
);
This is exactly what StochK function
returns.
Then slow stochastic %D is smoothed again
line:
SLOWSTOCHD = MA( SLOWSTOCHK, 3
);
You can check the following formula for
reference:
MaxGraph<FONT
face=Arial> = <FONT
color=#ff00ff>4;<FONT
color=#000000>
FASTSTOCHK = <FONT
color=#ff00ff>100*(C<FONT
face=Arial>-LLV(<FONT
color=#000000>L,<FONT
color=#ff00ff>14))/(HHV(<FONT
color=#000000>H,<FONT
color=#ff00ff>14)-LLV(<FONT
color=#000000>L,<FONT
color=#ff00ff>14));
Graph0 = SLOWSTK =
MA<FONT
color=#000000>( FastStochK, <FONT
color=#ff00ff>3
); // calculated Slow Stoch %K
Graph1 =
<FONT
color=#0000ff>StochK( <FONT
color=#ff00ff>14<FONT face=Arial
size=2> ); // built in Slow Stoch %K
Graph2 =
MA<FONT
color=#000000>( Graph1, <FONT
color=#ff00ff>3
); // calculated Slow Stoch %D
Graph3 =
<FONT
color=#0000ff>StochD( <FONT
color=#ff00ff>14 ); // built-in Slow Stoch
%D
Best regards,Tomasz
Janeczko===============AmiBroker - the comprehensive share
manager.<FONT face=Arial
size=2>http://www.amibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
saltyla1
To: <A title=amibroker@xxxxxxxxxxxxx
href="">AMInewsgroup
Sent: Saturday, October 20, 2001 9:22
PM
Subject: [amibroker] StochK? or
StochD
Hello T.J. , and all, First, if any one has any
reference to the proper calculation of Stoch%K please post it.And, I'm no
expert, but when I put one and one together, something didn't add up. So,here
it is;In the AFL Function reference it states that STOCHK has built
in (with internal slowing 3).STOCHK SYNTAX stochk( periods =
14 ) RETURNS ARRAY FUNCTION Calculates the %K line of
Stochastic Oscillator (with internal slowing 3). EXAMPLE The formula
"stochk( 5 )" returns the value of a 5-period %K slowed down 3 periods.
__________________________________________This is from the Windowon
Wall Street user guide;One must wonder why a smoothed component wouldhave
a different name, but you should understand that %K is the primary indicator
and %D and %D slow are merely smoothed values of the original %K. In other
words, you could plot %K and then put a 3-day moving average of it on theplot
and that would be %D. The different types of Stochastic Oscillators are as
follows: Stochastic Oscillator (exponential)Stochastic Oscillator
(simple)Stochastic Oscillator
(weighted)__________________________________________
In VarexList I saw thisstochKw = StochK(13);and
wondered if StochK(13) was really StochD(13) because of StochK's internal
slowing, meaning we don't really have a StochK at all.And then I saw
thisstochDw = EMA( StochK(13), 3);and thought that Jaco was trying to
slow a real StochK that wasn't already slowed, to slowing with a moving
average of his choice in order to make a StochD using an EMA slowing. If
StochK is already slowed, then what Jaco has done is slowed a real StochD
again.__________________________________________I think this StochD
would be good if it is not based on a StochK that is already slowed, but the
reference should include a statement as to what kind of slowing has been
applied to it I.E.(exponential,simple,weighted), so the user won't have to
make an EMA( StochK(13), 3) when that's what StochD is already
using.STOCHD SYNTAX stochd( periods = 14 ) RETURNS ARRAY
FUNCTION Calculates the %D line of Stochastic Oscillator (with
internal slowing 3). EXAMPLE The formula "stochd( 5 )" returns the value
of a 5-period %D slowed down 3 periods.
__________________________________________I was comparing graphs and
usingStochKwas the same as usingStoch
(Stoch with no K or D)Can you make one of these functions (StochK or
Stoch) a StochK with NO internal slowing?And, can you tell us if
StochD is using an already slowed StochK as reference for its
calculations?
Thankyou,BrianYour
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|