Skip to main content

Stochastic Oscillator Calculator

Calculate the stochastic oscillator %K and %D values for overbought/oversold analysis. Enter values for instant results with step-by-step formulas.

Share this calculator

Formula

%K = ((Close - Lowest Low) / (Highest High - Lowest Low)) x 100 | %D = SMA(%K, 3)

The %K line measures where the current closing price falls within the lookback period range as a percentage from 0 to 100. The %D signal line is a 3-period simple moving average of %K values. Readings above 80 are overbought and below 20 are oversold. Buy signals occur when %K crosses above %D in the oversold zone. Sell signals occur when %K crosses below %D in the overbought zone.

Worked Examples

Example 1: Oversold Buy Signal on EUR/USD

Problem: EUR/USD 14-period high: 1.1120, low: 1.0950, close: 1.0970. Previous %K values: 15, 12. Previous %D: 14. Identify the signal.

Solution: %K = (1.0970 - 1.0950) / (1.1120 - 1.0950) x 100\n= 0.0020 / 0.0170 x 100 = 11.76%\n%D = (11.76 + 15 + 12) / 3 = 12.92%\nZone: Oversold (below 20)\nPrevious: %K(15) > %D(14) = K above D\nCurrent: %K(11.76) < %D(12.92) = K below D\nBearish crossover in oversold zone

Result: %K: 11.76 | %D: 12.92 | Zone: Oversold | Signal: Watch for Buy (wait for bullish crossover to confirm reversal)

Example 2: Overbought Sell Signal on GBP/USD

Problem: GBP/USD 14-period high: 1.2700, low: 1.2500, close: 1.2685. Previous %K values: 88, 82. Previous %D: 85. Analyze.

Solution: %K = (1.2685 - 1.2500) / (1.2700 - 1.2500) x 100\n= 0.0185 / 0.0200 x 100 = 92.50%\n%D = (92.50 + 88 + 82) / 3 = 87.50%\nZone: Overbought (above 80)\nPrevious: %K(88) > %D(85) = K above D\nCurrent: %K(92.50) > %D(87.50) = Still K above D\nNo crossover yet, momentum still bullish

Result: %K: 92.50 | %D: 87.50 | Zone: Overbought | Signal: Watch for Sell (await bearish crossover for confirmation)

Frequently Asked Questions

How is the %K line calculated in the Stochastic Oscillator?

The %K line is calculated using the formula: %K = ((Current Close - Lowest Low) / (Highest High - Lowest Low)) x 100. The Lowest Low and Highest High refer to the minimum and maximum prices over the lookback period (typically 14 periods). For example, if the 14-period high is 1.1120, the 14-period low is 1.0950, and the current close is 1.1050, then %K = ((1.1050 - 1.0950) / (1.1120 - 1.0950)) x 100 = (0.0100 / 0.0170) x 100 = 58.82%. This means the current close is at 58.82% of the 14-period range, slightly above the midpoint. The %K line is the more sensitive of the two lines and reacts quickly to price changes.

What is the difference between fast and slow stochastic?

The fast stochastic uses the raw %K calculation and a 3-period SMA for %D. It is very responsive but produces many signals, including false ones. The slow stochastic smooths the output by using the fast %D as its new %K line, then calculating a new %D as a 3-period SMA of this smoothed %K. This double-smoothing reduces whipsaws and provides cleaner signals. Most traders prefer the slow stochastic because the fast version generates too many false signals in choppy markets. There is also a full stochastic that allows customizing all three parameters: %K lookback period, %K smoothing period, and %D smoothing period. The default full stochastic settings are 14, 3, 3 (14-period lookback, 3-period %K smoothing, 3-period %D smoothing).

What are the best Stochastic Oscillator trading signals?

The highest probability stochastic signals combine multiple factors. The strongest buy signal occurs when %K crosses above %D in the oversold zone (below 20) and then rises above 20, especially when this coincides with a bullish price pattern or support level. The strongest sell signal is when %K crosses below %D in the overbought zone (above 80) and drops below 80, ideally at resistance. Divergence signals are also powerful. A bullish divergence occurs when price makes a lower low but %K makes a higher low, suggesting weakening downward momentum. Bearish divergence is when price makes a higher high but %K makes a lower high. The weakest signals are neutral zone crossovers (between 20 and 80), which produce many false signals and are best avoided without additional confirmation.

What lookback period should I use for the Stochastic Oscillator?

The default 14-period lookback works well for most applications, but different trading styles benefit from adjustments. For scalping on 1-5 minute charts, shorter periods like 5 or 8 provide faster signals but more noise. For day trading on 15-minute to 1-hour charts, the standard 14 period is optimal. For swing trading on daily charts, some traders extend to 21 periods for smoother signals. For position trading on weekly charts, 14 periods (representing 14 weeks) provides long-term momentum analysis. Shorter lookback periods make the oscillator more sensitive, producing earlier signals but more false positives. Longer periods create smoother readings with fewer but more reliable signals. Always backtest different settings on your specific instrument and timeframe before committing real capital.

How do I identify divergence with the Stochastic Oscillator?

Divergence occurs when price and the stochastic oscillator move in opposite directions, signaling weakening momentum and a potential reversal. Bullish divergence forms when price makes a lower low (or equal low) while the stochastic %K makes a higher low, indicating selling pressure is diminishing despite lower prices. Bearish divergence forms when price makes a higher high (or equal high) while %K makes a lower high, indicating buying momentum is fading despite higher prices. For reliable divergence signals, look for at least two clear swing points to compare on both price and the oscillator. Hidden divergence (continuation signals) works in reverse: price making higher lows with stochastic making lower lows confirms an uptrend continuation. Divergence is most reliable on higher timeframes and when confirmed by other indicators.

Can the Stochastic Oscillator be used in trending markets?

Yes, but the approach must differ from range-bound markets. In trending markets, standard overbought/oversold signals often fail because the stochastic remains in extreme territory during strong trends. The solution is to use the stochastic as a pullback entry tool rather than a reversal signal. In an uptrend, wait for the stochastic to pull back to the oversold zone or neutral area, then enter long when %K crosses above %D, trading in the direction of the trend. In a downtrend, wait for stochastic rallies to the overbought zone and sell when it crosses back down. This pullback approach leverages the mean-reversion behavior of the stochastic while respecting the dominant trend. Combining stochastic with a trend filter like a 200-period moving average or Ichimoku Cloud significantly improves win rates in trending conditions.

References