Skip to content

Stochastic Oscillator

The Stochastic Oscillator Technical Indicator compares where a security’s price closed relative to its price range over a given time period.

The Stochastic Oscillator is displayed as two lines. The main line is called %K. The second line, called %D, is a Moving Average of %K. The %K line is usually displayed as a solid line and the %D line is usually displayed as a dotted line.

There are several ways to interpret a Stochastic Oscillator. Three popular methods include:

  • Overbought and oversold levels. Buy when the Oscillator (either %K or %D) falls below a specific level (for example, 20) and then rises above that level. Sell when the Oscillator rises above a specific level (for example, 80) and then falls below that level.
  • Line crossovers. Buy when the %K line rises above the %D line, and sell when the %K line falls below the %D line.
  • Divergences. Look for divergences between the Oscillator and prices. For instance, when prices are making a series of new highs and the Stochastic Oscillator is failing to surpass its previous highs.
%K (solid) and %D (dashed) with the overbought (80) and oversold (20) levels.

The Stochastic Oscillator has three parameters: the %K period (the number of bars used for the calculation), the slowing value (the internal smoothing of %K) and the %D period (the period of the moving average applied to %K).

%K = SUM(CLOSE - MIN(LOW, %K period), slowing) / SUM(MAX(HIGH, %K period) - MIN(LOW, %K period), slowing) * 100
%D = SMA(%K, %D period)

Where:

  • CLOSE is today’s closing price;
  • MIN(LOW, %K period) is the lowest low over the %K period;
  • MAX(HIGH, %K period) is the highest high over the %K period;
  • SMA is a simple moving average.