MOMENTUM & OSCILLATORS

Stochastic Oscillator

Where today's close sits inside the recent high-low range, 0–100.

spec id: stochoutputs: k · dk (default 14) · d (default 3)

What does Stochastic measure?

A 0-100 meter for where today's close sits inside the recent trading range. 100 means it closed at the very top of it.

How is Stochastic calculated?

Find the highest high and the lowest low of the last 14 candles, and see where today's close falls between them — that is `k`. `d` is `k` averaged over the last 3 candles, and it is the slower line traders watch for crossings.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do traders read Stochastic?

Below 20 = closing near the range lows (oversold); above 80 = near the highs. The %K line crossing %D is the classic trigger.

The honest caveat

In a strong trend it pins at the extreme and stays there — "oversold" can keep falling.

How do I use Stochastic in a bot?

Add indicator → Stochastic. Outputs: k, d.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on Stochastic — the first backtest is free.

Run a free backtest