The stochastic formula, derived
Derive %K from the close, the lowest low, and the highest high over the lookback window.
Lesson path
Technical Analysis + Price Action
Stochastic and Momentum
Pass the check before saving this lesson.
Pass the check to unlock nextOpen track mapChange starting pointToday's tiny win: make one idea click.
Derive %K from the close, the lowest low, and the highest high over the lookback window.
Where did this candle close inside the recent range?
The stochastic oscillator is a momentum indicator built on one simple observation. In an uptrend, candles tend to close near the top of their recent range. In a downtrend, candles tend to close near the bottom. The indicator turns that observation into a single number between 0 and 100 that updates with every new candle close. George Lane gets credit for the design in the late 1950s. The formula has not changed since.
Here is the formula in plain steps. Step one: pick a lookback period. The default is 14 candles. Step two: find the lowest low and the highest high inside that window. Step three: take the current close and ask where it falls inside that high-low range. Step four: divide the distance from the window low to the close by the full range of the window, then multiply by 100. That output is called %K, and it is the raw stochastic.
Written cleanly: %K equals open paren close minus lowest low close paren divided by open paren highest high minus lowest low close paren, times 100. The denominator is the full range. The numerator is the distance from the bottom of that range up to the current close. If the close is exactly at the window high, %K equals 100. If it is exactly at the window low, %K equals 0. Right in the middle, %K equals 50. That bounded behavior is why the oscillator lives in a sub-panel below price, on its own 0 to 100 axis.
One detail to internalize. The lookback window slides forward with every new candle. Today's window is the most recent 14 candles. Tomorrow's window drops the oldest candle and adds the new one. That means the lowest low and highest high anchors can change candle by candle. A new swing high inside the window will rebase the denominator. That is why a sudden surge in price moves %K so fast: the close jumps, but the range also expands, and the ratio adjusts in real time.
Recap: %K = ((close minus lowest low) divided by (highest high minus lowest low)) times 100. Default lookback 14. Output bounded 0 to 100. The number simply tells you where the candle closed inside its recent range.
Knowledge check
Answer before moving on.
1. What is %K actually measuring?
2. Over the last 14 candles, the lowest low was 1.0800, the highest high was 1.0900, and the current close is 1.0875. What is %K?
3. Why does %K respond so quickly when price makes a sharp move?
Pass the check before saving.
Use the knowledge check first. After you pass it, this card turns into the save-and-continue handoff.