Skip to content

    Stochastic Oscillator Calculator

    Stochastic oscillator calculator: get %K and %D from the close, the high-low range and previous values. Follow a worked example and see why charts differ.

    31 January 2026
    14 min read
    2,666 words

    A stochastic oscillator locates a closing price within its recent high-low range. Enter the close, the range and previous indicator values in this calculator to get its Percent K, Percent D, Zone and Crossover results. This form smooths by averaging repeated previous values, so its displayed readings are approximations rather than a complete standard stochastic calculation. The worked example below shows exactly why its Percent K can differ from the raw formula printed above.

    A short form cannot recreate the full indicator history

    The form does not collect the earlier observations needed for full smoothing. A crossover label based on these approximate outputs is not a verified chart event. Check a complete series with matching settings before comparing results.

    A close near the top of its range

    The raw calculation is: Fast %K = (Close - Lowest Low) / (Highest High - Lowest Low) x 100. The high and low come from the same lookback window, including the bar whose close you are measuring. A bar is a chart interval, such as a completed daily session or an intraday interval.

    For valid data within a non-flat range, the raw result runs from zero to 100. It is a location within that window, not a percentage return, a probability of profit or an estimate of how far price will move. An identical closing price can have a different reading when an older high or low leaves the lookback window.

    Fidelity describes stochastic as a momentum indicator comparing the close with the high-low range. MetaQuotes’ documentation likewise distinguishes the main line from its moving-average signal line. A moving average smooths several observations; it cannot be reconstructed reliably from a single earlier value.

    Use the five fields as they are labelled

    • Current Close: the closing price for the bar you are analysing. Use a completed bar for a stable comparison.
    • 14-Period High: the highest traded high across the same 14-bar window. It is not an average of the highs or merely the highest closing price.
    • 14-Period Low: the lowest traded low in that window.
    • Previous %K: the previous indicator value, using the same symbol and chart interval.
    • Previous %D: the previous signal-line value from that same setup.

    There is no symbol selector, price-history field or smoothing-period control. You supply the high and low yourself. The labels specify 14 periods; they do not mean calendar days when you are studying intraday bars. The helper text mentions today and yesterday, but the arithmetic itself simply uses the values entered.

    Use one price basis throughout. Do not take a current close from one chart interval and the range from another. Also check whether a chart adjusts earlier prices for corporate actions before comparing its indicator with independently copied numbers. This form does not reconcile mismatched data for you.

    Why Percent K is not the raw Fast %K

    In the standard fast version, %D is commonly a three-period simple moving average of raw %K. In a slow version, the raw %K is smoothed first, then the slow %D averages the smoothed readings. StockCharts’ own documentation separates fast, slow and fully adjustable versions. The names therefore matter when comparing indicators.

    This form follows a shorter route. It calculates the current raw %K, adds Previous %K twice, then divides the total by 3. That becomes the displayed Percent K. It then adds Previous %D twice to that result and divides by 3 for Percent D. Repeating a previous reading is a substitute for missing history; it is not the same as averaging distinct observations.

    The tool also treats an entered zero for Previous %K or Previous %D as missing and substitutes a fallback. Zero is a legitimate boundary reading in a stochastic series, so this changes an otherwise valid input. A different result from your chart may therefore reflect both the smoothing shortcut and the zero-value handling.

    How to calculate %K and %D step by step

    To calculate the stochastic oscillator by hand you need a series of bars, not a single day. Each bar needs a high, a low and a close. The steps for the fast version are: take the highest high and lowest low of the last 14 bars, including the current one; subtract the lowest low from the close; divide by the range between the highest high and the lowest low; multiply by 100. That gives %K. Then %D is a 3-bar simple moving average (the plain average of the last three values) of %K.

    Below is a made-up 16-bar daily series. The prices are invented to show the arithmetic and are not data for any share or index. %K can only start from bar 14, because that is the first bar with a full 14-bar window.

    Invented prices for teaching. Not real market data.
    BarHighLowClose
    110298100
    2104100103
    310399101
    4105101104
    5107103106
    6106102104
    7108104107
    8110106109
    9109105106
    10111107110
    11113109111
    12112108110
    13114110113
    14115111112
    15113109112
    16116111115
    Worked from the invented table above. Results are indicator levels, not returns.
    BarWindow usedHighest highLowest lowCloseRaw %K
    14Bars 1 to 1411598112(112 - 98) / (115 - 98) x 100 = 82.35
    15Bars 2 to 1511599112(112 - 99) / (115 - 99) x 100 = 81.25
    16Bars 3 to 1611699115(115 - 99) / (116 - 99) x 100 = 94.12

    Fast %D on bar 16 is the average of the last three raw %K values: (82.35 + 81.25 + 94.12) / 3 = 85.91. Notice how the window moves. On bar 15 the lowest low rose from 98 to 99 because bar 1 dropped out of the window. That is why the same close can give a different reading on a later day.

    Compare this with the calculator above. It asks for one close, one high and one low, plus your previous %K and %D. It cannot see the earlier bars, so it repeats the previous value instead. The step-by-step method here uses real earlier readings, which is how a chart does it.

    Fast, slow and full stochastic explained

    StockCharts describes three versions. They share the same raw %K and differ only in how much smoothing (averaging to reduce noise) is applied.

    Source: StockCharts ChartSchool, Stochastic Oscillator Fast, Slow and Full, checked 28 Oct 2026.
    Version%K line%D lineCommon setting
    FastRaw %K3-period SMA of raw %K14,3
    SlowRaw %K smoothed by a 3-period SMA3-period SMA of slow %K14,3
    FullRaw %K smoothed by an X-period SMAX-period SMA of full %K14,3,3

    The slow version is the same as a full stochastic with 14,3,3 settings. The third number is the smoothing, sometimes called slowing, applied to %K. A larger smoothing number makes the line calmer and slower to react. A shorter look-back gives a more jumpy line that touches 0 and 100 more often.

    What settings like 14,3,3 or 9,6 mean

    Settings are read in order: look-back, then smoothing of %K, then the %D period. So 14,3,3 means a 14-bar range, a 3-bar smoothing of %K and a 3-bar %D. A shorthand such as stoch(9,6) is usually read as a 9-bar look-back and a 6-bar %D or smoothing value, but the order differs between charting platforms. Open your platform's indicator settings and read the labels before comparing numbers with anyone else.

    • Shorter look-back (for example 5 or 9): reacts faster, spends more time near 0 and 100, and gives more false extremes.
    • Longer look-back (for example 21): reacts slower and shows fewer extremes.
    • Longer smoothing: fewer line crossings, but each crossing arrives later.
    • The same settings on a 5-minute chart and a daily chart describe very different amounts of time.

    Stochastic oscillator in a spreadsheet

    You can rebuild the fast version in Excel or Google Sheets. Put the high in column B, the low in column C and the close in column D, with data starting in row 2. In row 15 (the 14th bar), enter these formulas:

    • Raw %K in E15: =(D15-MIN(C2:C15))/(MAX(B2:B15)-MIN(C2:C15))*100
    • Fast %D in F17, once E15 to E17 are filled: =AVERAGE(E15:E17)
    • Slow %K: the same AVERAGE formula over three raw %K cells; slow %D then averages three slow %K cells.

    Copy the %K formula down. The spreadsheet adjusts the ranges so the window moves one row at a time. If the highest high equals the lowest low the range is zero and the formula returns an error; wrap it in IF to show a blank for flat windows.

    Stochastic vs RSI vs Stochastic RSI

    RSI details from StockCharts ChartSchool, checked 28 Oct 2026. Zones are conventions and can be adjusted.
    IndicatorWhat it measuresTypical defaultUsual extreme zones
    Stochastic oscillatorWhere the close sits inside the recent high-low range14,3,3Above 80 and below 20
    RSIAverage gains compared with average losses over the period (J. Welles Wilder, 1978)14Above 70 and below 30
    Stochastic RSIA stochastic formula applied to RSI values instead of pricesPlatform dependentPlatform dependent

    Neither is better. They answer different questions, so identical readings do not mean the same thing. A stochastic reading depends on the recent high and low. RSI depends on the size of recent gains and losses. Our pages on the RSI indicator and Stochastic RSI explain each one.

    Using these readings in a journal

    If you use a stochastic reading in a trade, write down the settings, the chart interval and the reading on the bar you acted on. Later you can compare outcomes by setting, rather than guessing which version you used. OneTradeJournal records trades by hand, with strategy and notes fields for exactly this. It does not import chart data and gives no signals. See also the stochastic trading strategy page.

    A fictional calculation from price range to output

    For this made-up example, enter Current Close ₹2,460, 14-Period High ₹2,520, 14-Period Low ₹2,280, Previous %K 60 and Previous %D 55. These are invented prices and indicator readings, not data for a particular share or index.

    Fictional inputs checked 15 Oct 2026 against the existing calculator formula. Results are indicator levels, not returns.
    StepArithmeticResult
    Close above window low2,460 - 2,280180
    Window range2,520 - 2,280240
    Raw Fast %K180 / 240 x 10075
    Displayed Percent K(75 + 60 + 60) / 365%
    Displayed Percent D(65 + 55 + 55) / 358.33%

    The display calls this BULLISH ZONE because the smoothed K is in the upper half of its scale. Its Crossover result says Bullish (%K above %D). In the example, the previous K was already above the previous D, so that text describes the current relationship. It does not mean a new crossing just occurred.

    Notice the difference between the raw 75 and the displayed 65. The formula shown above the tool describes the raw calculation, while its result card uses the smoothed shortcut. Changing the high and low alone does not resolve that difference. A full calculation needs separate earlier K observations and the corresponding smoothed history.

    Zone names describe readings, not orders

    The usual convention calls readings above 80 overbought and below 20 oversold. Those words describe where the oscillator is on its scale. They do not mean an asset is fundamentally expensive or cheap. A strong trend can keep the oscillator near an extreme while prices continue moving in the same direction.

    A crossing also needs a before-and-after comparison of the same lines. Seeing K above D on a single bar is insufficient to show it crossed on that bar. This form compares the entered previous values with its newly approximated values, so its crossing label inherits the approximation. It does not establish what happened on a complete chart.

    If both lines are equal, the result can still label their relationship bearish, meaning downward. A flat price window can also produce a fallback indicator value rather than explaining that the raw formula has no nonzero range to divide by. These cases are reasons to inspect the inputs, not evidence of a market direction.

    What to compare when chart readings disagree

    • Check the same symbol, bar interval and completed-bar timestamp.
    • Check the window high and low, including whether the current bar belongs to that window.
    • Check whether the chart shows fast, slow or full stochastic.
    • Check the lookback, smoothing lengths and averaging method.
    • Allow for this form’s repeated-value shortcut and zero-input fallback; matching the settings cannot remove missing history.

    The stochastic strategy explanation adds context about interpretation and failure cases. For a different oscillator, see the RSI calculator. RSI measures a different relationship, so identical thresholds or readings should not be assumed to mean the same thing.

    The similarly named Stochastic RSI applies a stochastic calculation to RSI values, rather than directly using this price window. The stochastic momentum index is another separate indicator. Confirm which indicator your chart uses before trying to reconcile its result with this form.

    Stochastic calculator questions

    Sources

    📓 Tools show what happened, a journal shows why. Turn these numbers into better decisions, start your trading journal India.

    Related Topics

    stochastic oscillator calculatorstochastic %K %D calculationfast versus slow stochasticstochastic smoothing

    Related Articles

    OneTradeJournal

    The trading journal for Nifty, Bank Nifty and Indian F&O. Track your trades, spot patterns, build discipline.

    • Log one trade a day by hand, on purpose
    • AI mentor finds your repeat mistakes
    • Behavioural analytics catch tilt early
    • Trading calendar with P&L heatmap
    • Pre-trade checklist flags risks
    Start journaling free

    Yearly ₹3,499 · No broker credentials

    Trading journal India