The Stochastic Oscillator is another popular oscillator that
is widely used. The premise behind its calculation is that when a security is
rising, it tends to close near the high of a recent period and a falling
security closes near its low. So, the Stochastic actually measures the price of
a security relative to the high/low range over a set period of time. Thus it
provides an indication of where the security is presently trading within its
recent trading range.
CALCULATION
The formula for the Stochastic Oscillator (%K) is
In the above formula:
C = Present closing price L_{n} = Lowest low for the
last `n' periods
H_{n} = Highest high for the last `n' periods n = number of periods
used in calculation
The indicator itself oscillates between 0 and 100, with
readings below 20 considered oversold and readings above 80 considered
overbought. As such, this indicator lends itself well to positive/negative
divergences.
SYNTAX Stoch(%k Periods, %k Slowing)
%k Periods _ This will determine the recent trading range
that is used in the calculations.
%k Slowing _ To help smooth out the %K line, a slowing factor
can be used. The slowing factor will take the last `x' number of periods and
average the closing prices from all those periods. This helps remove an erratic
behaviour from the oscillator.
Note: Another line which is commonly used in conjunction with
the %K is called the %D line. MetaStock does not have a custom %D line within
its functions, however, the %D line is simply a moving average of the %K line.
Therefore if we wish to use the %D line, we will need to use the following:
Mov(Stoch(%k Periods, %k Slowing),3,S)
EXAMPLE
Here is an example using the Stochastic Oscillator:
Stoch(8,3)
In the above example:
%k periods = 8
%k slowing = 3
APPLICATION
A more useful application of this example could be:
Stoch(8,3)>20 AND Ref(Stoch(8,3),1)<20 {This could also be
achieved with the Cross function)
This formula specifies that the present value of the
stochastic oscillator is to be above the 20 reference line, and that the
previous period's value to be less than 20. The other common reference line is
normally set at 80. A basic strategy with the Stochastic Oscillator is to go
long when the Stochastic crosses above the 20 reference line and to go short
when it crosses below the 80 reference line.
Looking at Figure 3.33, we can see the Stochastic Oscillator
indicator at the base of the chart
Figure 3.33 _ Stochastic Oscillator Indicator
EXERCISES
Construct formulas for the following:
1. The Stochastic Oscillator (using 8 periods and a slowing
factor of 3) is above the %D line:
__________________________________________________
2. The Stochastic Oscillator (same as above) crosses above
the %D line and the %K line is below 20:
__________________________________________________
This
article is a snippet from the
MetaStock Programming Study Guide...
"Discover
The Simple Secret to Make Metastock Easy & Identify Profitable
Trades"

copyright 2007 www.metaformula.com