What Is the Stochastic Oscillator, and What Do %K and %D Plot?
The stochastic oscillator scales where the latest price sits inside the high-low range of a set number of recent bars onto a line from 0 to 100, and the smoothing applied to that figure is what separates %K from %D.

The stochastic oscillator reports where the latest price sits between the highest high and the lowest low of a fixed number of recent bars, scaled onto a line running from 0 to 100. A price finishing at the top of that window reads near 100 and one finishing at the bottom reads near 0, which is the whole of the calculation.
Everything else under the name is either smoothing or interpretation. In Sierra Chart's documentation the two plotted lines are that ratio and a moving average of it; in the 2017 study of Chinese index futures cited later here, both plotted lines are already averages, and the raw ratio has a different name altogether. So the number of smoothing steps behind a line labelled %K depends on whose document you are reading, which is worth settling before you lift a rule out of one. Chen, Zhou and Wang, the authors of that study, credit George Lane with promoting the oscillator in the 1950s.
What does the stochastic oscillator measure?
The stochastic oscillator measures position inside a range. Take the highest high and the lowest low over a window of recent bars, measure how far up that span the most recent price closed, and express the answer as a percentage of the span's total height. Chen, Zhou and Wang class it as a momentum indicator and tie it in the same breath to support and resistance.
Because the output is a percentage of whatever the range happens to be, the indicator carries no information in dollars. Put the formula to work on two windows: one four points tall, with the last price 3.6 points above its low, reads 90, and a forty-point window with the last price 36 points above its low reads 90 as well. That is the point of a bounded oscillator and also its main limitation — it is scale-free by construction, so anything you want to do with it in contract terms has to come from somewhere else.
Three line names circulate from the one calculation — %K, %D, and a third called %J. Those three names are why the indicator is also published as KDJ. Chen, Zhou and Wang describe it as displayed as two lines, with %J as something traders sometimes add; Sierra Chart documents KDJ as a separate study that plots the two slow lines and adds the J line to them.
How is the stochastic oscillator calculated?
Sierra Chart's documentation for its KD - Fast study gives the arithmetic in two steps. The first line, which that platform calls Fast %K, is one hundred times the difference between the last price and the lowest low of the window, divided by the difference between the highest high and the lowest low of the same window. Where that denominator comes out at zero — every bar in the window sharing one high and one low — the study returns 100 rather than attempting the division.
The second line is a simple moving average of the first, over a length you set separately. Sierra Chart labels that second line "Fast %D (aka Slow %K)", and the double name is deliberate: the average of the raw figure is the fast version's slow line and the slow version's fast line at the same time.
A third step produces the slow form. Sierra Chart's KD - Slow study plots that same average alongside a further moving average of it, so the slower of its two lines is an average of an average. Each smoothing step costs warm-up bars, and the documentation gives the point at which each study starts: the fast one is computed from the bar index equal to the sum of its two lengths, and the slow one from the sum of its three.
That is the entire construction. One ratio, then one or two averages of it, and a pair of horizontal lines drawn wherever the user asks for them.
What is the difference between a fast and a slow stochastic?
A fast stochastic plots the raw ratio and one average of it. A slow stochastic drops the raw ratio and plots one average and a second average of that, so both of its lines are smoothed. Sierra Chart documents its Stochastic - Fast study as identical to KD - Fast and its Stochastic - Slow as identical to KD - Slow, which makes the comparison a matter of how many smoothing steps are visible.
| Fast | Slow | KDJ | |
|---|---|---|---|
| First line plots | the raw ratio | one average of the raw ratio | one average of the raw ratio |
| Second line plots | one average of the raw ratio | an average of that average | an average of that average |
| Lengths you set | two | three | three |
| Extra line | none | none | J, equal to three times the slow %K minus twice the slow %D |
| Sierra Chart equivalent | KD - Fast |
KD - Slow |
KDJ |
The family is larger than those three. Sierra Chart's studies contents page lists fourteen study names carrying the word Stochastic, plus the three above named without it. Two of the fourteen show how far the name stretches. Stochastic RSI runs the min-max step over an RSI series of the closing price rather than over the bars, with a separate window length of its own for that step. Stochastic - Percentile replaces the ratio with a percentile rank of the input over a moving window, scaled by the window size minus one; Sierra Chart attributes that one to Peter Worden and notes it is sometimes called a Worden stochastic.
Is %K the raw figure or a smoothed one?
Both, depending on the document. Sierra Chart's Fast %K is the unsmoothed ratio, and the average of it is named Fast %D. Chen, Zhou and Wang define a quantity they call RSV as the unsmoothed ratio, then define %K as a recursive average of RSV and %D as a recursive average of %K. The same symbol therefore sits one smoothing step apart in the two sources.
This matters more than a labelling quibble. If you read a trading rule written in one convention and apply it to lines drawn in the other, you are using a series that has been averaged once more or once less than the author intended. The J line inherits the problem: Chen, Zhou and Wang build it from their %K and %D, while Sierra Chart builds its J from the slow pair, and the two expressions share the same three-times-minus-twice-the-other shape over different inputs.
The averaging method is a second place the same inputs give different outputs. Sierra Chart's KD - Fast, KD - Slow and KDJ studies each take a Moving Average Type input, and the simple average in their formulas can be swapped for any of six others — Wilders, exponential, weighted, smoothed, linear regression and a skip-zeros variant of the simple average. On the slow study that one input governs both of its averaging steps. Our post on the RSI covers the same mechanism on a different oscillator, where it is the main reason two platforms disagree about a number that looks like it ought to be fixed.
A third is the input series. Sierra Chart exposes the high, the low and the last as three separately selectable inputs, so none of them has to be the bar's own high, low or close.
What do the 20 and 80 lines mean?
The 20 and 80 lines are levels somebody typed in. Sierra Chart's KD - Fast, KD - Slow and KDJ studies each draw two horizontal lines at levels taken from inputs the documentation names without attaching a number to either, and the same is true of the fast and slow stochastic pages. The familiar 20 and 80 appear in Chen, Zhou and Wang as example thresholds inside one of three reading conventions that paper describes as popular, which is the honest provenance for them.
Those three conventions, ordered by how much judgement each asks of the reader:
Line crossover. The paper's version is to buy when %K rises above %D and sell when %K falls below it. This needs no threshold at all, only the two lines.
Threshold re-cross. Buy when either line drops under a level the paper gives as 20 and then climbs back over it; sell on the opposite trip through a level it gives as 80. Note the shape — it is the return through the level, not the reading itself, that the convention keys on.
Divergence. Price setting a series of new highs while the oscillator fails to exceed its own previous highs. This is the most interpretive of the three: what counts as a series, and as a failure, is left to the reader.
A bounded oscillator will sit at an extreme for as long as a market keeps closing near the edge of its own recent range — a mechanical consequence of the formula, not a prediction about what happens next. None of the three conventions is a recommendation from us, and Chen, Zhou and Wang list them as popular readings rather than as findings of their own. What they did test, and what the test returned, is the next section.
Has the stochastic oscillator been tested on futures?
The stochastic oscillator has been tested on index futures, in one market, at very short horizons. Chen, Zhou and Wang ran stationary versions of three indicators — a moving average rule, Bollinger bands and KDJ — over CSI 300 Stock Index Futures traded on the China Financial Futures Exchange, using 15-second, 30-second and 60-second data running from 4 January 2012 to the end of December 2016.
The KDJ rule they tested is a crossover with a band filter: open long when %K crosses up through %D while %K sits between 20 and 80, close long on the opposite crossing, and the mirror image on the short side. They drew the three parameters from five combinations — including (5,3,3), (9,3,3) and (14,3,3) — which gave fifteen KDJ strategies once the three data frequencies were counted. The authors tested stationarity with an ADF test and screened for data snooping with Hansen's SPA test, the point of the second being to ask whether a rule that looked good did so because it was good or because enough rules had been tried.
Scope is worth stating plainly. One contract, one exchange, second-level frequencies: it is evidence about that contract at those frequencies, and it says nothing about the E-mini S&P 500 or about a five-minute chart.
What did the test find once costs were included?
Transaction costs removed the result. Without them, Chen, Zhou and Wang report significant parameter combinations for each of the three indicators under the SPA test. With costs included, the paper's conclusion is that profits are eliminated and no strategy is significant.
The step-down version of the test was less kind to KDJ than to the other two before costs even entered. Once the data-snooping correction was stepped down through the pool, the authors report, KDJ was no longer significant on the 15-second data at the 5% and 10% levels, while the moving average and Bollinger rules still did well at all three frequencies for some of their parameter sets.
Their own explanation for the cost result is partly institutional. Their cost table lists six levels across the five years, and the two increases in it land in August and September 2015: the authors describe the change dated 7 September 2015 as taking the cost to a hundredfold of what had been charged between the second half of 2012 and mid-2015. The expensive regime therefore occupies the last sixteen months of a sixty-month sample. The authors also note the limit of their own method: an SPA test can still miss a rule that genuinely has predictive power.
Both halves of that are worth holding. The rule produced in-sample results that survived a data-snooping screen on the slower two frequencies, and it did not survive being charged for its trades. Searching a parameter grid until something passes is the failure mode our post on curve fitting is about, and a study that applies the screen and then reports the costs is doing the opposite of that.
What does a stochastic reading mean on a funded account?
Nothing, in dollars, which is the practical point. The oscillator's output is bounded between 0 and 100 and is computed from a ratio, so it cannot tell you what a position is risking. The rule that ends a simulated funded account here is denominated the other way: the drawdown line is a dollar level a fixed distance below your highest end-of-day balance, it is monitored in real time through the session, and a balance that touches it liquidates the account.
The two numbers never meet on their own. Converting a chart reading into a position means going through tick value and the contract limit, which caps what you may hold at once across every open position and rejects an over-limit order at the platform. How many stops fit inside the drawdown line, and what the ceiling would risk in a single fill, is worked through in futures position sizing.
One more mechanical point about the window. A stochastic of length 14 is 14 bars of whatever your chart is built from, and bars are not interchangeable: Quantower's documentation has a tick bar closing once a fixed count of trades has printed, where a time-based bar closes on the clock instead. On a tick chart, fourteen bars is a count of trades and spans however long those trades took to arrive, so the "period" in a period setting is a property of the chart rather than of the clock. The difference between the two aggregations is covered in tick charts versus time charts.
FAQ
What are the usual stochastic oscillator settings?
Chen, Zhou and Wang write that the smoothing parameters are usually taken as 3 and 3, with the lookback window at 5, 9 or 14 — a statement about common practice rather than a prescription. Sierra Chart's documentation for its fast and slow stochastic studies prints no default for the lengths or for the two horizontal lines, so a figure quoted as "the default" comes from a particular platform's settings file.
Is the Stochastic RSI the same thing as the stochastic oscillator?
No. Sierra Chart documents its Stochastic RSI study as applying the min-max transform to an RSI series computed from closing prices, with a separate window length for that step and an RSI length of its own. The KD - Fast and KD - Slow studies run the transform over the high, low and last inputs instead. One reads where a price sits in a price range, the other where an RSI value sits in an RSI range.
What is the J line in KDJ?
Sierra Chart's KDJ study plots the same two lines as its slow stochastic and adds a third, computed as three times the slow %K minus twice the slow %D. Rearrange that and J is the slow %K plus twice the gap between the two lines, so it always sits further out than slow %K whenever they differ, and it is not confined to the 0-to-100 band the other two are: slow %K at 100 with slow %D at 50 puts J at 200. Chen, Zhou and Wang use the same three-minus-two formula over their own %K and %D.
Does a reading above 80 mean a market is overbought?
On the raw ratio, a reading above 80 means the last price closed in the top fifth of the window's high-low range. On a smoothed line it means only that the average of that ratio is above 80, which is a weaker statement about where the last price actually closed. Either way that is all the arithmetic supports: the 80 is a level a user types into a line input, and in the futures study cited here the 20-to-80 band filtered crossover signals rather than generating them.
What is a Worden stochastic?
It is Sierra Chart's Stochastic - Percentile study, which the platform attributes to Peter Worden and says is sometimes called by that name. It ranks the window's values from lowest to highest and reports the latest value's rank as a percentage of the window length minus one, with a moving average of that rank alongside.
Sources
- Sierra Chart — Technical Studies Reference: KD - Fast
- Sierra Chart — Technical Studies Reference: KD - Slow
- Sierra Chart — Technical Studies Reference: KDJ
- Sierra Chart — Technical Studies Reference: Stochastic - Fast
- Sierra Chart — Technical Studies Reference: Stochastic - Slow
- Sierra Chart — Technical Studies Reference: Stochastic - Percentile
- Sierra Chart — Technical Studies Reference: Stochastic RSI
- Sierra Chart — Technical Studies Reference (contents)
- Chen, Zhou & Wang — Profitability of simple stationary technical trading rules with high-frequency data of Chinese Index Futures (arXiv:1710.07470, 2017)
- Quantower Help — Tick Bars
- Lumen Futures Help Center — Drawdown explained
- Lumen Futures Help Center — Contract limits
Educational content about futures markets and simulated trading. Not investment advice, and not a solicitation to trade. Trading futures involves substantial risk of loss. Read the full risk disclosure.