
Stochastic Oscillator
The stochastic oscillator is an indicator used in technical analysis, created by George Lane in the 1950s, to compare the closing price of a commodity to its price range over a given time span. The idea behind the stochastic oscillator is that prices tend to close near their recent highs in bull markets, and near their recent lows in bear markets. Action signals can be spotted when the stochastic oscillator crosses its moving average, or by spotting divergence of oscillator and actual price.
Two stochastic indicators are usually calculated to assess future fluctuations in prices, a fast (%K) and a slow (%D). Comparing these statistics is a good indicator of the speed at which prices are changing or the momentum of price. %K is the same as the Williams %R, but on a scale of 0 to 100 instead of -100 to 0.
The fast stochastic oscillator, which is %K, calculates the ratio of two closing price statistics: The difference between the latest closing price and the lowest price in the last N days over the difference between the highest and lowest prices in the last N days:
\%K = { CP_{today's} - LOW_{lowestNDays} \over HIGH_{highestNdays} - LOW_{lowestNDays} } \times 100
Where: CP is closing price, LOW is low price, and HIGH is high price.
The usual "N" is 14, 9 or 5 days. When the current closing price is the low for the last N-days, the %K value is 0, when the current closing price is a high for the last N-days, %K=100.
The slow stochastic oscillator or stochastic %D calculates the simple moving average of the stochastic %K statistic across s periods . Usually s=3:
\%D = { SMA_3 \; of \; ( CP_{today's} - LOW_{lowestNDays} ) \over SMA_3 \; of \; ( HIGH_{highestNdays} - LOW_{lowestNDays} ) } \times 100
Slow\%D = \%SD = SMA_3 \; of \; \%D
The %K and %D oscillators range from 0 to 100 and are often visualized using a line chart. Levels near the extremes 100 and 0, for either %K or %D, indicate strength or weakness (respectively) because prices have made or are near new N-day highs or lows.
One method of using stochastic as a signal generator is based on the crossing of the %K and %D lines. When the %K crosses the %D, it can indicate a change in trend. The problem is that these cross overs happen very frequently leading to whipsaws.
A better way to use the oscillators is when %K or %D levels get above 80 and below 20, it can be interpreted as overbought or oversold. Assuming prices do oscillate, many analysts including George Lane recommend that buying and selling be timed to the return from these thresholds. Another way of saying this is, one should buy or sell after a bit of a reversal. This means that once the price exceeds one of these thresholds, the investor should wait for prices to return through those thresholds. For instance, if the oscillator were to go above 80, the investor waits until it falls below 80 to sell.
The third way that stock traders use the stochastic oscillator is to watch for divergences where the Stochastic trends in the opposite direction of price. This is an indication that the momentum in the market is slowing and a reversal may be coming. Often times stock traders will wait for the cross below the 80 or above the 20 line before entering a trade on divergence, and this is a good idea. It should be mentioned that the existence of price oscillation is a theory, stock price movements are a result of buying and selling by market participants based on their assumption of future prices, fear, and greed.