What is Stochastic?
The Stochastic oscillator measures where the latest close sits inside the range between the highest high and the lowest low of the recent window. 100 means the close is at the top of that range and 0 means it is at the bottom. Altrady Charts plots two lines in their own pane, %K and %D, a moving average of %K, with dashed levels at 80 and 20.
Stochastic shows the close's position in the recent range. It does not show trend direction or the size of the range, and a reading near 100 or 0 does not mean price is about to turn.
How to use Stochastic
- Above 80 or below 20. By convention, above 80 is read as overbought and below 20 as oversold. In a strong trend price keeps closing near the edge of its range, so the lines can stay there for many bars.
- %K crossing %D. %K is the faster line. When it crosses above %D the close has moved up within the range faster than its recent average; a cross below is the reverse. Crossings are frequent, especially in sideways markets.
- Divergence. A new price high with a lower Stochastic high means the latest close finished less near the top of its range than before.
- Smoothing. At the default %K Smoothing of 1, %K is the raw reading and moves sharply. Raising it to 3 gives the smoother version many traders call the slow Stochastic.
These are ways to read the lines, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| %K Length | 14 | Bars in the high-low range. Lower makes the oscillator more sensitive and more often extreme; higher is calmer. Minimum 1. |
| %K Smoothing | 1 | Bars in a simple average applied to the raw value to form %K. At 1 there is no smoothing. Minimum 1. |
| %D Smoothing | 3 | Bars in the simple average of %K that forms %D. Higher makes %D slower and crossings rarer. Minimum 1. |
Adjust the three lengths in the indicator settings. The 80 and 20 levels are fixed, and the calculation always uses the high, low and close.
Calculation
The raw value is the close's distance above the lowest low, as a percentage of the window's full range. %K and %D are simple averages layered on top:
raw = 100 * (close - lowest low of 14 bars) / (highest high of 14 bars - lowest low of 14 bars)
%K = SMA(raw, 1)
%D = SMA(%K, 3)
With the default %K Smoothing of 1, %K is the raw value unchanged. The first %K appears on the 14th bar, once the window is full, and the first %D two bars later, once three %K values exist.
If the high and low are identical across all 14 bars, the range is zero and there is no value for that bar. That needs a completely flat window, so it is rare outside illiquid markets.
Limitations
- Overbought is not a sell signal. In a strong trend closes cluster near the top or bottom of the range, holding the lines beyond 80 or 20.
- Many crossings in sideways markets. With the default settings %K is unsmoothed, so it crosses %D often and many of those crossings lead nowhere.
- It ignores the size of the range. A close at the top of a narrow range and at the top of a wide one both read 100.
- The live candle moves. The current bar's values change until that bar closes.
- It depends on timeframe and lengths. The same market gives different readings on 15m and 1D, or at different window lengths.
Frequently asked questions
The Stochastic oscillator shows where the latest close sits within the highest high and lowest low of a recent window, on a 0 to 100 scale. It has two lines, %K, the reading itself, and %D, a moving average of %K.
Above 80 is read as overbought and below 20 as oversold, by convention. Traders also watch %K crossing %D and divergences between the oscillator and price. In a trend the lines can stay at an extreme for many bars, so none of these is a signal on its own.
Yes. The indicator declares three inputs: %K Length, default 14; %K Smoothing, default 1; and %D Smoothing, default 3, each with a minimum of 1. Open the indicator's settings on the chart to change them. Setting %K Smoothing to 3 gives the smoother slow Stochastic.
The fast version uses the raw reading as %K. The slow version smooths that reading first, usually over three bars. In Altrady Charts this is the %K Smoothing input. The default of 1 gives the fast version.
Values on bars that have already closed are not revised. The current candle's values move while it is still live, because its close, high and low can still change, and settle when it closes. Each value uses only a fixed window of past bars, so loading older history does not change it.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Stochastic already applied. On any other market, open the indicator picker on the chart and choose Stochastic from the Oscillator group.