Indicators

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).

Stochastic %K
%K = (close - lowest low) / (highest high - lowest low) * 100

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.

Stochastic %D
%D = SMA(%K, D-period)

%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.

Fast vs Slow Stochastic
Simula offers two Stochastic variants. The Fast Stochastic (StochF) uses the raw %K described above. The Slow Stochastic (Stoch) applies an additional smoothing step to %K before calculating %D. The slow variant reduces noise and produces fewer signals. Most traders use the slow variant -- it is the default "Stochastic Oscillator" in Simula.

%K/%D Crossover Signals

The most common Stochastic strategy uses crossovers between the %K line (fast) and the %D line (slow):

8020Sell signal%K crosses below %DBuy signal%K crosses above %D%K (fast)%D (slow / signal)
Sell signal: %K crosses below %D in the overbought zone. Buy signal: %K crosses above %D in the oversold zone.
Buy signal
%K crosses above %D from below. This is strongest when it occurs in the oversold zone (below 20), suggesting the price is bouncing from the bottom of its range.
Sell signal
%K crosses below %D from above. This is strongest when it occurs in the overbought zone (above 80), suggesting the price is falling from the top of its range.

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

%K Period (default: 14)
The lookback window for finding the highest high and lowest low. Shorter periods make %K more responsive but noisier. Longer periods produce a smoother line but react slower to price changes.
%D Period (default: 3)
The smoothing period for the signal line. A larger %D period produces a smoother signal line but delays crossover signals.
Slowing (default: 3, Slow Stochastic only)
An additional smoothing applied to %K before %D is calculated. This is what makes the Slow Stochastic smoother than the Fast variant. A value of 1 effectively turns the Slow Stochastic into the Fast variant.

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.

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.