Stochastic Oscillator Calculator (%K and %D)

Calculate Stochastic %K from current close vs N-period high and low range.
Includes overbought 80+ and oversold 20- momentum trading signals.

Stochastic %K

George Lane developed the Stochastic in the late 1950s. His core insight: in an uptrend, prices close near the high of the range. In a downtrend, they close near the low. The oscillator measures where today’s close sits within the recent high-low range:

%K = 100 × (Close - Low_N) / (High_N - Low_N)

Default N is 14 periods. %K runs from 0 to 100. Above 80 = upper end of range (overbought). Below 20 = lower end (oversold).

%D is %K smoothed. Standard %D is a 3-period simple moving average of %K. Many platforms also smooth %K itself with a 3-period SMA before computing %D, and that variant is the “Slow Stochastic.” The version with raw %K is the “Fast Stochastic.” Slow is far more common because raw %K whipsaws too hard.

Lane’s actual signal. People remember Stochastic for the 80/20 levels, but Lane himself said divergences were the real edge. Price making a higher high while %K makes a lower high = bearish divergence, and vice versa. The 80/20 levels are framing, not triggers.

The trap with overbought. Same trap as RSI. In a strong trend, %K stays above 80 for many bars. Selling every print above 80 in a bull run loses money fast. A better rule: only act on overbought/oversold when price has rolled over off the level, not on the first crossing.

Stoch RSI. Some traders apply the Stochastic formula to the RSI value itself, looking at where current RSI sits within its own recent high-low range. It magnifies the signals, and the noise with them.

Worked example. Last 14 bars: Highest high = 105.40, Lowest low = 98.20. Current close = 103.10.

  • %K = 100 × (103.10 - 98.20) / (105.40 - 98.20)
  • %K = 100 × (4.90 / 7.20) = 68.06

That puts the close in the upper third of the range but not overbought. Bullish bias, no extreme.

Work backwards and it gets more useful. The same range says the close would have to reach 103.96 to print 80, and drop to 99.64 to print 20. Those are prices you can put on a chart, unlike the oscillator reading itself. A trader watching for an overbought print is really watching for 103.96, and knowing that turns a lagging indicator into a level.

Getting %D out of it. %D is the 3-period simple moving average of %K, so it needs this bar’s reading and the two before it. If the last three %K values were 61.20, 64.50 and 68.06, then %D = (61.20 + 64.50 + 68.06) / 3 = 64.59. %K above %D is the bullish crossover everyone trades, and here %K at 68.06 sits above %D at 64.59, so the crossover has already happened. Enter your two previous readings in the optional fields and the calculator does this step.

The crossover on its own is a weak signal. Lane’s point was that it means something at the edges of the range and almost nothing in the middle, which is why the professional version of the rule is “crossover, but only below 20 or above 80.”


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.