Stochastic oscillator

Updated November 30, 2026 · One of the 11 oscillators in TradingView's technical rating

The stochastic oscillator shows where the latest close sits within the range of recent highs and lows, on a scale from 0 (at the lowest low) to 100 (at the highest high). George Lane developed it in the 1950s on the idea that momentum changes before price does: in a rising market closes tend to cluster near the top of the range, and when they stop doing so the rise may be tiring.

At a glance

TypeMomentum oscillator, bounded 0 to 100
Created byGeorge Lane, 1950s
Standard settings14, 3, 3: a 14-period range, %K smoothed over 3 periods, %D over 3 more
Classic levelsAbove 80 overbought, below 20 oversold
TradingView ratingBuy if %K and %D are both below 20 and %K is above %D; Sell if both are above 80 and %K is below %D

How it’s calculated

TradingView’s help page gives the calculation as:

Raw %K = 100 × (close − lowest low) ÷ (highest high − lowest low)   over the last 14 periods
%K     = 3-period simple average of raw %K
%D     = 3-period simple average of %K

With these settings %K is itself smoothed, a version often called the slow stochastic. %D is a smoothed copy of %K, and the two lines crossing is the indicator’s main signal.

Worked example: 18 days

A hypothetical stock falls for two weeks and then starts to recover:

DayHighLowCloseDayHighLowClose
152.1051.2051.401048.9048.0048.20
251.8050.9051.001148.6047.7047.90
351.4050.5050.601248.4047.5047.60
451.0050.1050.301348.1047.2047.30
550.6049.7049.801447.9047.0047.10
650.3049.4049.601547.8046.9047.20
749.9049.0049.101648.0047.1047.80
849.7048.8049.001748.3047.4048.10
949.2048.3048.401848.7047.8048.60

Raw %K on day 14 uses days 1–14: the highest high is 52.10 (day 1) and the lowest low is 47.00 (day 14). Raw %K = 100 × (47.10 − 47.00) ÷ (52.10 − 47.00) = 100 × 0.10 ÷ 5.10 = 1.96. The close is almost at the bottom of the two-week range.

The same calculation for the following days, each using its own 14-day window:

DayClose14-day high14-day lowRaw %K%K (3-day average)%D (3-day average of %K)
1447.1052.1047.001.96
1547.2051.8046.906.12
1647.8051.4046.9020.009.36
1748.1051.0046.9029.2718.46
1848.6050.6046.9045.9531.7419.85
  • %K on day 16 = (1.96 + 6.12 + 20.00) ÷ 3 = 9.36
  • %K on day 18 = (20.00 + 29.27 + 45.95) ÷ 3 = 31.74
  • %D on day 18 = (9.36 + 18.46 + 31.74) ÷ 3 = 19.85

What TradingView’s rule says on day 18. %K (31.74) is above %D (19.85), the kind of upturn many traders look for after an oversold stretch. But the rule needs both lines below 20, and %K has already risen above 20, so the reading is Neutral (0). Earlier, on day 17, %K was 18.46. Whether the rule fired that day depends on %D, which needs %K for day 15, and that needs data from before day 1.

The example shows how strict the rule is. A buy reading needs the turn to happen while both lines are still deep in oversold territory.

How traders read the stochastic

From TradingView’s help page:

  • Overbought and oversold. The default thresholds are 80 and 20. TradingView notes that it is usually best to trade with the trend when using these levels, because overbought or oversold conditions can be a sign of a strengthening trend rather than a coming reversal.
  • Divergence. A bullish divergence is a lower low in price with a higher low in the stochastic; a bearish divergence is a higher high in price with a lower high in the stochastic.
  • Bull and bear setups. These invert divergences. In a bull setup, price makes a lower high while the stochastic makes a higher high; TradingView describes the dip that follows as a possible bullish entry before price rises. A bear setup is the reverse: a higher low in price with a lower low in the stochastic, followed by a bounce that TradingView describes as a possible bearish entry.
  • %K and %D crossovers. %K crossing above %D is read as bullish, below as bearish, and these matter most near the 20 and 80 levels.

How TradingView’s rating uses it

Stochastic (14, 3, 3) is one of the 11 oscillators:

ReadingCondition
Buy (+1)%K below 20, %D below 20, and %K above %D
Sell (−1)%K above 80, %D above 80, and %K below %D
Neutral (0)Anything else

Settings and variations

  • Fast stochastic. With a %K smoothing of 1, %K is the raw value and reacts to every close; it is much noisier.
  • Longer ranges (such as 21 periods) make the indicator steadier.
  • The related Williams %R uses the same 14-period range but measures from the top, and the Stochastic RSI applies the same formula to RSI values instead of prices.

Limitations

  • Overbought can stay overbought. In strong trends the stochastic can stay above 80, or below 20, for long stretches.
  • Range-dependent. One large spike widens the 14-day range for two weeks and compresses every reading in that time.
  • Noisy on short timeframes, where the high-low range is small.

See it on a live chart

Stochastic (14, 3, 3) under daily candles. The legend shows %K, then %D; the shaded band marks 20 to 80.

For TradingView's current rating of any market, with this indicator among the 26, see the market analysis page or the technical signals for all markets.

Sources

This page explains how an indicator is calculated and how traders commonly read it. The worked examples use hypothetical prices. Nothing here is a recommendation to buy or sell any investment. This content is for informational purposes only and does not constitute financial advice. Consult a qualified financial advisor before making investment or financial decisions.