Skip to content

Stochastic Oscillator

The Stochastic Oscillator is a technical indicator that compares a security’s closing price to its price range over a specific time period.

The Stochastic Oscillator is represented by two lines: %K and %D. The %K line is a solid line, while the %D line is a dotted line. The %D line is a Moving Average of the %K line.

There are three popular methods for interpreting the Stochastic Oscillator:

  • 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.

The Stochastic Oscillator is a useful tool for analyzing price movements and identifying potential buying or selling opportunities.