TraderAI
FeaturesPricingBlog
Sign InGet Started
  1. Home
  2. Indicator library
  3. Stochastic Oscillator
Momentum

Stochastic Oscillator

The Stochastic Oscillator shows where the latest close sits within the high-low range of recent candles, on a scale from 0 to 100. A reading of 80 means the close was near the top of that range; 20 means near the bottom.

Open on live chart All indicators

Adds Stochastic Oscillator to a free BTC/USDT chart.

Formula

raw %K = 100 * (C - lowest L) / (highest H - lowest L)   over N bars;  50 when the range is 0
%K = SMA(raw %K, smoothing)
%D = SMA(%K, D length)

How TraderAI calculates it

TraderAI uses a 14-candle range with %K smoothing 3 and %D 3 by default. Raw %K compares the close with the lowest low and highest high of the last 14 candles; when that range is zero, raw %K is 50. %K is a 3-period simple average of raw %K, and %D is a 3-period simple average of %K. The first value appears after 18 candles.

Live example

How traders read it

  1. 1

    Readings above 80 and below 20 are the usual overbought and oversold zones; they show where price closed in its range, not that it must turn.

  2. 2

    %K crossing %D is read as a short-term change in momentum, and means more outside the middle of the range.

  3. 3

    Divergence between price and the stochastic can show that new highs or lows are closing weaker than before.

Limitations

  • In a strong trend the stochastic can stay above 80 or below 20 for a long time.
  • It reacts quickly and gives many crosses in noisy markets.

Settings and defaults

SettingDefaultAllowed range
%K period141 to 200
%K smoothing31 to 50
%D period31 to 50

What it plots

Drawn in its own pane below the price chart, with its own scale.

LineUnitDrawn asFirst value
%KPercentLineafter 18 candles
%DPercentLineafter 18 candles

Calculation notes

  • Position of the close within the recent high-low range, smoothed into %K and %D. A flat range reads 50.

Questions

What is Stochastic Oscillator?

The Stochastic Oscillator shows where the latest close sits within the high-low range of recent candles, on a scale from 0 to 100. A reading of 80 means the close was near the top of that range; 20 means near the bottom.

How does TraderAI calculate Stochastic Oscillator?

TraderAI uses a 14-candle range with %K smoothing 3 and %D 3 by default. Raw %K compares the close with the lowest low and highest high of the last 14 candles; when that range is zero, raw %K is 50. %K is a 3-period simple average of raw %K, and %D is a 3-period simple average of %K. The first value appears after 18 candles.

What are the default settings of Stochastic Oscillator?

The defaults are %K period: 14, %K smoothing: 3, %D period: 3. You can change every setting on the live chart.

Can I use Stochastic Oscillator for free on TraderAI?

Yes. Every indicator in the library can be added to the free live chart. The free plan keeps up to 2 indicators active at the same time; Pro lets you combine more on one chart.

Educational content. Indicators describe past prices; they do not predict future prices and are not investment advice.

Category
Momentum
Drawn as
Drawn in its own pane below the price chart, with its own scale.
First value
after 18 candles
Formula version
traderai-classic-v1
Open on live chart

Free plan: up to 2 indicators active at the same time. Pro lets you combine more indicators on one chart.

See plans

Related indicators

  • Commodity Channel Index
  • MACD
  • RSI
  • Stochastic RSI
  • Williams %R
  • Gator Oscillator
How TraderAI's AI reads a chart