Stochastic Oscillator
Where the price closed within its recent range -- fast vs slow variants, %K/%D crossovers, and how it differs from RSI.
What is the Stochastic Oscillator?
The Stochastic Oscillator measures where the current closing price sits within the recent high-low range. If the price closed at the very top of its range, the Stochastic reads 100. If it closed at the very bottom, it reads 0. If it closed exactly in the middle, it reads 50.
The idea is simple: in an uptrend, prices close near the top of their range. In a downtrend, they close near the bottom. When the Stochastic reading reaches an extreme, the price may be stretched relative to its recent range.
How It's Calculated
The Stochastic produces two lines: %K (the main line) and %D (the signal line, which is a moving average of %K).
In plain English: find the highest high and lowest low over the last N candles. Then see where the current close sits within that range. If the close is at the top, %K is 100. If the close is at the bottom, %K is 0.
%D is simply the simple moving average of %K over the last D-period candles (default 3). It smooths out %K and serves as a signal line for crossover strategies.
%K/%D Crossover Signals
The most common Stochastic strategy uses crossovers between the %K line (fast) and the %D line (slow):
Crossovers that occur in the middle of the range (between 20 and 80) are generally considered weaker signals because the price is not at an extreme.
The 80/20 Levels
Stochastic uses 80 and 20 as its standard overbought and oversold thresholds (compared to 70/30 for RSI). The same caution applies: overbought does not mean "sell now" and oversold does not mean "buy now." In a strong trend, the Stochastic can remain at extreme levels for many candles.
Parameters
Stochastic vs RSI
Both are oscillators on a 0-100 scale, but they measure different things:
RSI measures the ratio of recent gains to losses. It answers: "how strong is the recent momentum?" RSI can stay elevated even when the price pulls back slightly, as long as the average gain still dominates.
Stochastic measures where the close sits within the recent range. It answers: "where did the price close relative to its recent high and low?" Stochastic responds immediately when the close moves away from the range extreme, making it more reactive to short-term price movement.
In practice, Stochastic produces more frequent signals than RSI because it reacts to every shift in the closing price relative to the range. RSI is more stable because the smoothing method (Wilder's) carries forward the history of gains and losses.
Things to Watch Out For
Frequent crossovers in choppy markets
When the price moves sideways in a narrow range, %K and %D will cross back and forth frequently, generating many signals with little follow-through. Adding a trend filter (like requiring price to be above a moving average for buy signals) can filter out these false crossovers.
Stochastic pins at extremes during strong trends
During a strong uptrend, the close consistently sits near the top of the range, and %K can stay near 100 for extended periods. The Stochastic is not broken -- it is correctly reporting that the close is at the top of the range. This is normal behavior in a trending market, and treating it as a sell signal fights the trend.
Where to Go Next
RSI (Relative Strength Index) -- a different approach to measuring overbought/oversold conditions.
CCI (Commodity Channel Index) -- an unbounded oscillator for measuring deviation from the mean.
Oscillators Overview -- all 8 oscillator types available in Simula.
Mean Reversion -- strategies that use oscillator crossovers and extreme readings.