Stochastic Oscillator: What It Is, How It Works, How To Calculate

What Is a Stochastic Oscillator?

A stochastic oscillator is a momentum indicator comparing a particular closing price of a security to a range of its prices over a certain period of time. The sensitivity of the oscillator to market movements is reducible by adjusting that time period or by taking a moving average of the result. It is used to generate overbought and oversold trading signals, utilizing a 0–100 bounded range of values.

Key Takeaways

  • A stochastic oscillator is a popular technical indicator for generating overbought and oversold signals.
  • It is a popular momentum indicator, first developed in the 1950s.
  • Stochastic oscillators tend to vary around some mean price level since they rely on an asset's price history.
  • Stochastic oscillators measure the momentum of an asset's price to determine trends and predict reversals.
  • Stochastic oscillators measure recent prices on a scale of 0 to 100, with measurements above 80 indicating that an asset is overbought and measurements below 20 indicating that it is oversold.
Stochastic Oscillator

Investopedia / Jessica Olah

Understanding the Stochastic Oscillator

The stochastic oscillator is range-bound, meaning it is always between 0 and 100. This makes it a useful indicator of overbought and oversold conditions.

Traditionally, readings over 80 are considered in the overbought range, and readings under 20 are considered oversold. However, these are not always indicative of impending reversal; very strong trends can maintain overbought or oversold conditions for an extended period. Instead, traders should look to changes in the stochastic oscillator for clues about future trend shifts.

Stochastic oscillator charting generally consists of two lines: one reflecting the actual value of the oscillator for each session, and one reflecting its three-day simple moving average. Because price is thought to follow momentum, the intersection of these two lines is considered to be a signal that a reversal may be in the works, as it indicates a large shift in momentum from day to day.

Divergence between the stochastic oscillator and trending price action is also seen as an important reversal signal. For example, when a bearish trend reaches a new lower low, but the oscillator prints a higher low, it may be an indicator that bears are exhausting their momentum and a bullish reversal is brewing.

Image

Image by Sabrina Jiang © Investopedia 2021

Formula for the Stochastic Oscillator

%K = ( C L14 H14 L14 ) × 100 where: C = The most recent closing price L14 = The lowest price traded of the 14 previous trading sessions H14 = The highest price traded during the same 14-day period %K = The current value of the stochastic indicator \begin{aligned} &\text{\%K}=\left(\frac{\text{C} - \text{L14}}{\text{H14} - \text{L14}}\right)\times100\\ &\textbf{where:}\\ &\text{C = The most recent closing price}\\ &\text{L14 = The lowest price traded of the 14 previous}\\ &\text{trading sessions}\\ &\text{H14 = The highest price traded during the same}\\ &\text{14-day period}\\ &\text{\%K = The current value of the stochastic indicator}\\ \end{aligned} %K=(H14L14CL14)×100where:C = The most recent closing priceL14 = The lowest price traded of the 14 previoustrading sessionsH14 = The highest price traded during the same14-day period%K = The current value of the stochastic indicator

Notably, %K is referred to sometimes as the fast stochastic indicator. The "slow" stochastic indicator is taken as %D = 3-period moving average of %K.

The general theory serving as the foundation for this indicator is that in a market trending upward, prices will close near the high, and in a market trending downward, prices close near the low. Transaction signals are created when the %K crosses through a three-period moving average, which is called the %D.

The difference between the slow and fast Stochastic Oscillator is the Slow %K incorporates a %K slowing period of 3 that controls the internal smoothing of %K. Setting the smoothing period to 1 is equivalent to plotting the Fast Stochastic Oscillator.

History of the Stochastic Oscillator

The stochastic oscillator was developed in the late 1950s by George Lane. As designed by Lane, the stochastic oscillator presents the location of the closing price of a stock in relation to the high and low prices of the stock over a period of time, typically a 14-day period.

Lane, over the course of numerous interviews, has said that the stochastic oscillator does not follow price, volume, or anything similar. He indicates that the oscillator follows the speed or momentum of price.

Lane also reveals that, as a rule, the momentum or speed of a stock's price movements changes before the price changes direction. In this way, the stochastic oscillator can foreshadow reversals when the indicator reveals bullish or bearish divergences. This signal is the first, and arguably the most important, trading signal Lane identified.

Example of the Stochastic Oscillator

The stochastic oscillator is included in most charting tools and can be easily employed in practice. The standard time period used is 14 days, though this can be adjusted to meet specific analytical needs. The stochastic oscillator is calculated by subtracting the low for the period from the current closing price, dividing by the total range for the period, and multiplying by 100.

As a hypothetical example, if the 14-day high is $150, the low is $125 and the current close is $145, then the reading for the current session would be: (145-125) / (150 - 125) * 100, or 80.

By comparing the current price to the range over time, the stochastic oscillator reflects the consistency with which the price closes near its recent high or low. A reading of 80 would indicate that the asset is on the verge of being overbought.

Relative Strength Index (RSI) vs. Stochastic Oscillator

The relative strength index (RSI) and stochastic oscillator are both price momentum oscillators that are widely used in technical analysis. While often used in tandem, they each have different underlying theories and methods. The stochastic oscillator is predicated on the assumption that closing prices should move in the same direction as the current trend.

Meanwhile, the RSI tracks overbought and oversold levels by measuring the velocity of price movements. In other words, the RSI was designed to measure the speed of price movements, while the stochastic oscillator formula works best in consistent trading ranges.

In general, the RSI is more useful during trending markets, and stochastics more so in sideways or range-bound markets.

Limitations of the Stochastic Oscillator

The primary limitation of the stochastic oscillator is that it has been known to produce false signals. This is when a trading signal is generated by the indicator, yet the price does not actually follow through, which can end up as a losing trade. During volatile market conditions, this can happen quite regularly. One way to help with this is to take the price trend as a filter, where signals are only taken if they are in the same direction as the trend.

How Do You Read the Stochastic Oscillator?

The stochastic oscillator represents recent prices on a scale of 0 to 100, with 0 representing the lower limits of the recent time period and 100 representing the upper limit. A stochastic indicator reading above 80 indicates that the asset is trading near the top of its range, and a reading below 20 shows that it is near the bottom of its range.

What Does %K Represent on the Stochastic Oscillator?

On a stochastic oscillator chart, %K represents the current price of the security, represented as a percentage of the difference between its highest and lowest values over a certain time period. In other words, K represents the current price in relation to the asset's recent price range.

What Does %D Represent on the Stochastic Oscillator?

On a stochastic oscillator chart, %D represents the 3-period average of %K. This line is used to show the longer-term trend for current prices, and is used to show the current price trend is continuing for a sustained period of time.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. Fidelity. "Slow Stochastic."

  2. George Pruitt. "The Ultimate Algorithmic Trading System Toolbox + Website: Using Today's Technology To Help You Become A Better Trader." John Wiley & Sons, 2016.

  3. CMC Markets. "What Is the Stochastic Indicator?"

Compare Mortgage Lenders
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.
Take the Next Step to Invest
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.