Indicators

What the Stochastic Oscillator Is and How It Works

The Stochastic Oscillator starts from a simple idea: in a consistent rally, the price usually closes near the top of the recent trading range. In a consistent decline, it usually closes near the bottom. The indicator turns this observation into a 0-to-100 scale, showing where the last close sits within the high-low range of a given number of candles.

Created by George Lane in the 1950s, the Stochastic remains among the most used oscillators because it's easy to visualize and reacts relatively fast to changes in the market's pace. But, like any momentum indicator, it has limitations that only show up once you understand the math behind it.

The %K formula

The indicator's main line, called %K, follows this formula:

%K = 100 × (Current close − Lowest low of the period) ÷ (Highest high of the period − Lowest low of the period)

Suppose that, over an asset's last 14 candles, the high was R$ 110.00 and the low was R$ 90.00. If the most recent close was R$ 106.00, the calculation is:

%K = 100 × (106 − 90) ÷ (110 − 90) = 100 × 16 ÷ 20 = 80

A %K of 80 means the price closed in the top 20% of the observed price range — near the period's high, not necessarily at an all-time high.

What %D is for

Most platforms plot %K alongside a second line, %D, which is a simple moving average of %K (usually 3 periods). %D smooths out %K's sharp swings and works as a signal line: when %K crosses %D from below to above, some traders see buying strength coming in; when it crosses from above to below, selling strength.

It's also common to apply extra smoothing to %K itself before calculating %D — the so-called slow Stochastic —, which reduces false signals at the cost of reacting a bit more slowly.

Overbought and oversold: watch out for overreading

The most cited zones are above 80 (overbought) and below 20 (oversold). The classic mistake is treating this as an automatic sell or buy order. In a strong uptrend, %K can stay glued above 80 for many candles in a row, and selling just because the indicator is stretched means exiting a move that still had steam.

  • %K above 80: price closing near the top of the recent range — buying strength, not an automatic reversal signal.
  • %K below 20: price closing near the bottom of the recent range — selling strength, with the same caveat.
  • Divergence: when the price makes a higher high, but %K makes a lower high (or the opposite), momentum is losing strength even while the price still advances.

Where the indicator works best

The Stochastic tends to behave better in markets oscillating within a defined range, alternating between support and resistance, than in strong, prolonged trends. In a sideways range, %K and %D crossovers near the 20 and 80 extremes tend to mark turning points more often. In a strong trend, the ideal use is measuring corrections within the main move, not trying to predict the trend's end.

A practical example: on a currency pair in an uptrend, a pullback that takes %K from 90 to near 20 can represent just a healthy pause in the move, especially if the chart's highs-and-lows structure keeps rising. Selling just because the oscillator bottomed out would ignore the bigger context.

Putting the pieces together

The Stochastic Oscillator works best as part of a broader reading than alone. Combining it with the chart's main trend, with support and resistance levels, or with another indicator that measures trend strength helps filter out entries that would depend only on a number crossing 20 or 80. Like any technical analysis tool, it improves the quality of the reading, but doesn't eliminate the risk of a trade going wrong — position management and a loss limit remain a necessary part of the process, regardless of how clear the signal looks at the moment of entry.

Practice before you risk. Open your Astron account and test your ideas on the demo account with R$ 10,000 in virtual funds.

Create free account