On this page
Stochastic — Momentum, in its own panel below the chart.
What Stochastic measures
Raw %K is the close minus the lowest low of the window, divided by the distance between the highest high and the lowest low of the same window, multiplied by 100. It is built from bar highs and lows, so the reading is a position inside a range rather than a speed or an amount. A close at the top of the window gives 100 and a close at the bottom gives 0. When the window is perfectly flat, highest high equal to lowest low, the ratio has no meaning and the bar returns no value instead of a placeholder. Both moving averages are simple averages that propagate that absence: an incomplete or interrupted window leaves the line undefined rather than averaging across the hole, so the plotted period is always the real one.
The formula, as implemented
This is not how the indicator is usually defined elsewhere — it is what the shipped code computes, documented next to the implementation:
Stochastique (Lane) — variante LENTE : fast %K = 100·(close − LL_N)/(HH_N − LL_N) (HH == LL → null) %K = SMA_kSmooth(fast %K) ; %D = SMA_dPeriod(%K) Les SMA propagent les trous (fenêtre incomplète → null). Défauts 14/3/3 (la config « slow stochastic » standard). Sorties : [%K, %D].
How to read it
- Above 80, closes are landing in the upper fifth of the recent range; below 20, in the lower fifth. Both are descriptions of position, not exhaustion.
- A %K crossing above %D means the recent closes sit higher in the range than the slower average of the same measure. The two lines cross often, and most crossings happen inside the middle of the scale.
- During a directional move the oscillator frequently sits near one extreme and stays there. Waiting for it to leave the zone is a different decision from acting when it enters one.
- A sideways market keeps the two lines sweeping the full scale, because a narrow range makes every close a large percentage of it.
- Segments where the line disappears mark windows with no range at all, typically a frozen or very thin period.
Parameters and defaults
%K period, 14 by default and adjustable from 1 to 200, sets the range that the close is measured against. %K smoothing, 3 by default, is what turns the raw fast line into the slow one; %D period, also 3, averages that again. Both smoothing values accept 1 to 50. Setting %K smoothing to 1 leaves the raw fast line in place and gives the fast stochastic; raising either value adds delay in exchange for fewer crossings.
| Parameter | Type | Default | Range |
|---|---|---|---|
| %K period | number | 14 | 1 – 200 |
| %K smoothing | number | 3 | 1 – 50 |
| %D period | number | 3 | 1 – 50 |
What it does not show
The window is defined by two extremes, so a high that was defended by thousands of contracts and a high touched once by a single trade shape the scale identically: nothing in the formula weighs the activity behind those prices. Two smoothing stages also add several bars of delay before a turn appears on %D. The scale is relative to the window, so a 2-tick range and a 40-tick range both produce values between 0 and 100 and look identical on the pane. On bars built by tick or volume count rather than by time, the 14-bar window covers a different amount of clock time in fast and slow conditions.
Related indicators
- Williams %R — Momentum
- Momentum — Momentum
- MFI — Momentum
- TSI — Momentum
- ADX/DMI — Momentum
- Vortex — Momentum
This page in other languages
Frequently asked questions
- What is the difference between the fast and slow stochastic?
- The fast stochastic plots the raw %K line together with a short average of it. The slow stochastic, which is the default here, smooths raw %K first and then averages that smoothed line to obtain %D. The slow version crosses less often and reacts later, at the cost of showing each individual close less distinctly.
- What do the %K and %D lines mean?
- %K is the smoothed position of the close inside the high-low range of the last 14 bars. %D is a 3-period average of %K, so it is the slower of the two. The distance between them reflects how quickly closes have moved within the recent range.
- Why does the stochastic stay above 80 during a rally?
- Because each new close keeps landing near the top of a range whose high keeps being redefined by the same move. A value sitting at 80 or above simply means closes have consistently printed in the upper part of the recent range; the oscillator is bounded, so it cannot go on rising to express a stronger trend.