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
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.
%K crossing %D is read as a short-term change in momentum, and means more outside the middle of the range.
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
| Setting | Default | Allowed range |
|---|---|---|
| %K period | 14 | 1 to 200 |
| %K smoothing | 3 | 1 to 50 |
| %D period | 3 | 1 to 50 |
What it plots
Drawn in its own pane below the price chart, with its own scale.
| Line | Unit | Drawn as | First value |
|---|---|---|---|
| %K | Percent | Line | after 18 candles |
| %D | Percent | Line | after 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.