Camovia Tray™

Stochastic Oscillator

The Stochastic Oscillator answers one concrete question: where does the current close sit inside the recent high-low range? Closes near the top = buyers in control; near the bottom = sellers.

What it is

The Stochastic Oscillator, developed by George Lane, measures where the close sits relative to the recent high-low range: %K = 100 × (Close − Lowest Low) ÷ (Highest High − Lowest Low). Closes persistently near the top of the range mean buyers can hold price at highs; closes near the bottom mean sellers are pressing. It is more position-oriented than RSI and more sensitive to short-term turns — at the cost of more noise.

Origin

The Stochastic Oscillator was popularized by American trader George Lane from the 1950s through his seminars. Lane's core insight: "price leads momentum" — at a top, price still prints new highs while the oscillator refuses to, signaling that the quality of the rally is deteriorating. The KDJ variant popular in Chinese-speaking markets adds a J line on top of this indicator; MT5 ships the standard Slow Stochastic.

Download Camovia Tray free — check quotes, manage positions, and hide in one click from your system tray.

Download Free

The formula

Two lines plus one smoothing:

%K (fast) = 100 × (C − L_N) ÷ (H_N − L_N)
%D (signal) = SMA(3) of %K
Slow %K = SMA(3) applied to raw %K (MT5 default)

N is the lookback (default 5); H_N/L_N are the highest high and lowest low of the last N bars. MT5 defaults to 5/3/3: a 5-period %K, a 3-period %D, and one more 3-period smoothing on %K (the slowing) — hence "Slow Stochastic". The Chinese-market J line = 3×%K − 2×%D is not part of MT5's built-in version.

Worked example

A concrete scenario for what %K measures:

  1. The last 5 days traded between a low of 100 and a high of 110; today closes at 109.
  2. %K = 100 × (109 − 100) ÷ (110 − 100) = 90 — the close sits at the 90th percentile of the 5-day range.
  3. Buyers not only pushed price up but held the close near the top — high "close quality", a strength signature.

Flip it: if price rises but closes keep landing in the lower half of the range (low %K), rallies keep getting sold — the rise is hollow. The Stochastic watches exactly this "where does it close" detail, which is what separates it from RSI's gain/loss-ratio approach.

How to read it

Reading the 0–100 scale:

Range Common interpretation
80 – 100 Overbought: closes pinned at the top of the recent range — strong but stretched; often pauses in ranges
50 – 80 Bullish zone: closes consistently high, buyers in control
20 – 50 Bearish zone: closes low, sellers in control
0 – 20 Oversold: closes pinned at the bottom — weak but extreme; bounces often start in ranges
%K crossing %D Bullish/bearish cross; crosses below 20 or above 80 are the higher-quality ones

Like RSI, overbought is not a reversal guarantee — in strong trends %K can flatline above 80 for weeks. The Slow version trades sensitivity for less noise and is the practical choice; the Fast version (no slowing) is snappier but much noisier.

Common signals & usage

Oversold bullish cross

%K crosses above %D below 20 — the classic bounce signal; highest win rate in ranges, requires higher-timeframe confirmation in trends.

Overbought bearish cross

%K crosses below %D above 80 — momentum exhaustion cue; in trends it gets flattened repeatedly.

Divergence

Price makes a higher high while %K does not → bearish divergence (Lane's core insight: price leads momentum at tops); bullish divergence mirrors it.

The 50 filter

Treat 50 as the bull/bear line: look for buys only above 50 and sells only below 50 — filters out roughly half of all counter-trend noise.

Limitations & common mistakes

  • Flattening is enemy #1: in strong trends %K parks in the 80–100 band for weeks and every bearish cross is fake. Judge the trend first, then decide whether to trust overbought.
  • Noisier than RSI: %K reacts to every close position — gaps and long wicks whip it around. The Fast version (no slowing) is even wilder.
  • Divergences still need price confirmation: price extending after a divergence is normal — wait for the structural break.
  • KDJ vs Stochastic confusion: J is a Chinese-market extension (3%K−2%D); MT5's built-in has no J line. Watch the convention when reading domestic tutorials.
  • Parameter sensitivity runs high: 5/3/3 vs 14/3/3 produces a totally different character. Decide whether you want speed or stability before tuning.

Stochastic in MT5

The Stochastic Oscillator is a built-in MT5 oscillator (Slow version by default). The MQL5 function for programmatic use is iStochastic:

int iStochastic(string symbol, ENUM_TIMEFRAMES period, int Kperiod, int Dperiod, int slowing, ENUM_MA_METHOD ma_method, ENUM_STO_PRICE price_field);
MQL5 function iStochastic()
Default parameters Kperiod=5, Dperiod=3, slowing=3
Price field STO_LOWHIGH (uses high/low range)
Buffers 0=main (MAIN_LINE/%K), 1=signal (SIGNAL_LINE/%D)
Display window Sub-window (guides at 20 / 80)

The price_field offers STO_LOWHIGH (the standard algorithm) and STO_CLOSECLOSE (close-vs-close, a variant insensitive to the range). Default is STO_LOWHIGH, matching most tutorials and platforms. The J line must be computed manually as 3×K − 2×D.

Behavior across timeframes

15-minute

High-frequency signal zone — take oversold crosses only in the trend direction or noise drowns everything

1-hour / 4-hour

The main combo for range trading; divergence structures are clearest here

Daily

Classic 5/3/3 or 14/3/3; daily stochastic crosses often accompany multi-week rebounds

Weekly

A weekly %K recovering from oversold is a historic multi-month rebound signal — rare but very heavy

Indicator combinations

Common pairings for the Stochastic:

  • With RSI: Stochastic reads position (where price closes), RSI reads force (gain/loss ratio) — a joint oversold-recovery is the highest-quality signal of all. RSI
  • With MACD: MACD sets the trend direction; the Stochastic only finds oversold entries in that direction — filter plus timing. MACD
  • With MA: price reclaiming MA20 while %K crosses up from oversold is a common trend-recovery combo. MA

FAQ

Q Are Stochastic and KDJ the same indicator?

KDJ is the Chinese-market extension: %K and %D match the built-in version, plus a J line = 3×%K − 2×%D that amplifies turns. MT5's built-in shows only %K/%D — keep this in mind when comparing against domestic KDJ tutorials.

Q How is the Stochastic different from RSI?

Both are 0–100 momentum oscillators with different engines: the Stochastic measures where the close sits inside the recent range — more sensitive to short-term turns, noisier; RSI measures the ratio of average gains to losses — smoother, generally preferred for divergences. A joint oversold-recovery on both is a high-quality signal.

Q Why is price still rising while it is overbought?

In strong trends closes keep landing near the top of the range and %K stays pinned above 80 (flattening). Overbought means buyers are extremely strong right now — it is not a reversal instruction, and shorting it is a classic way to lose money.

Q What do MT5's default 5/3/3 settings mean?

%K looks back 5 bars, %D smooths over 3, and %K itself gets one more 3-period smoothing (slowing) — the standard Slow Stochastic. For more speed, shorten the periods or drop the slowing (Fast version), at the cost of noise.

Q How do I add the Stochastic in MT5?

Menu: Insert → Indicators → Oscillators → Stochastic Oscillator, or drag it from the Navigator onto a sub-window. The dialog exposes %K/%D/slowing periods, the smoothing method and the price field (Low/High by default).

Turn MT5 / MT4 into a Tray Tool

Check quotes, manage positions, and hide in one click.

Download Camovia Tray

This page is educational content about a technical indicator. It is not investment advice. Indicator signals can and do fail — always combine them with your own risk management.