Categories

Congestion Index is a bounded oscillator for MetaTrader 5, built by mladen, that measures how much price has actually moved relative to how wide its own recent trading range has been. It’s a free instant download for the MT5 subwindow, and it’s designed to answer a specific question: is the market making real directional progress, or just chopping sideways inside a congested range?
What Congestion Index Actually Calculates
For every bar, the indicator first measures a dividend: the percentage change between the current price (per the inpPrice input, close by default) and the price inpLookBack bars earlier (28 bars by default) — a straightforward rate-of-change over the lookback window. It then measures a divisor: the percentage spread between the highest high and lowest low over that same lookback window, relative to the lowest low. Dividing the rate-of-change by the range-spread produces a raw congestion value: when price has moved a large distance relative to how wide its own range has been, the ratio is large (trending); when price has barely moved despite a wide range, or moved only a little inside a narrow range, the ratio compresses toward zero (congested/choppy).
That raw value is then passed through two cascaded exponential moving averages. The first, using an alpha derived from inpSmoothPeriod (10 by default), smooths the raw ratio into the main Congestion Index line. The second, using an alpha derived from inpSignalPeriod (10 by default), smooths the main line again into a Signal line. Both are strictly recursive EMAs — each new value only ever references the previous bar’s already-computed value plus the current bar’s new input, with no re-averaging of historical bars once they’re set.
The space between the Congestion Index line and its Signal line is filled and color-coded (gray/blue/red depending on whether the main line is above, below, or crossing its signal), and the whole oscillator is bounded to a fixed -100/+100 scale with reference levels plotted at -85, -20, 0, +20, and +85.
How to Read It
Readings pushing toward the outer levels (+85/-85) indicate the market is covering real ground relative to its recent range — a directional, non-congested phase. Readings hovering near the zero line, especially inside the inner -20/+20 band, suggest price is chopping around inside a range without making meaningful net progress — the “congestion” the name refers to. The colored fill and line crossovers between the main Congestion Index and its Signal line work like any fast/slow oscillator pair: a cross of the faster line through the slower one flags a shift in whichever direction the ratio is currently trending, though because both lines are EMAs of a ratio (not of raw price), the crosses describe changes in the trend/congestion balance rather than direct price momentum.
Key Input Parameters
- inpLookBack (28): the bar count used for both the rate-of-change and the high/low range measurement.
- inpPrice (PRICE_CLOSE): which applied price feeds the rate-of-change calculation.
- inpSmoothPeriod (10): EMA period smoothing the raw ratio into the main Congestion Index line.
- inpSignalPeriod (10): EMA period smoothing the main line into the Signal line.
Using It Alongside a Trading Plan
Because Congestion Index doesn’t plot on price directly, most traders run it underneath a chart as a filter rather than a standalone signal generator. A common approach is to only take trend-following setups (breakouts, moving-average crosses, trendline breaks) when the index is pushing toward its outer levels, and to treat setups triggered while the index sits near the zero line with more skepticism, since the ratio itself is saying the market hasn’t been making net progress relative to its own range lately. Because the smoothing periods (inpSmoothPeriod and inpSignalPeriod) are both EMAs, the indicator reacts faster to a shift in the underlying ratio than a simple moving average would, which is worth keeping in mind if you’re used to slower congestion or ADX-style filters — Congestion Index can flip from congested to trending readings more quickly on volatile instruments.
Honest Limitations
Because the underlying ratio divides by the recent low, a lowest-low reading of exactly zero (only realistic on certain synthetic instruments) would zero out the divisor, and the raw value defaults to 0 per the code’s own guard clause. The indicator has no directional bias built in beyond the sign of the rate-of-change — it tells you whether the market is trending or congested, not which direction is likely to dominate next. It also carries no built-in alerts or arrow objects; reading it is purely visual, via the line position, the fill color, and the crossovers against the fixed reference levels. And because it’s a ratio of two already-smoothed quantities, it can occasionally lag a sudden volatility spike by a bar or two compared to raw price action.
- inpLookBack (default 28) — Bar count used for both the rate-of-change and the high/low range measurement.
- inpPrice (default PRICE_CLOSE) — Applied price used in the rate-of-change part of the calculation.
- inpSmoothPeriod (default 10) — EMA period smoothing the raw congestion ratio into the main line.
- inpSignalPeriod (default 10) — EMA period smoothing the main line into the Signal line.
FAQs About the MT4 Congestion Index Indicator MT5
Does Congestion Index repaint?
No. The calculation loop only steps forward from the last calculated bar, and both the main line and Signal line are built from their own previous value plus the current bar’s new ratio, so bars already plotted are never rewritten.
What does a reading near zero actually mean?
It means price has moved very little relative to how wide its own recent high-low range has been over the inpLookBack window — the market is congested/ranging rather than making net directional progress.
How is this different from a generic momentum oscillator like RSI?
Instead of just measuring price change, Congestion Index divides the rate-of-change by the recent high-low range spread, so it specifically distinguishes real trending progress from choppy movement inside a wide range, which a plain momentum reading can’t do on its own.
What do the -85, -20, +20, and +85 levels represent?
They’re fixed reference levels on the indicator’s -100/+100 scale, used as visual thresholds for judging when the congestion ratio has moved into a strongly trending or a strongly congested zone.
Can I change which price is used in the calculation?
Yes, the inpPrice input accepts any of MT5’s standard applied price types (close, open, high, low, median, typical, weighted), letting you base the rate-of-change measurement on something other than the close.
Congestion Index Indicator MT5
Congestion Index is a bounded oscillator for MetaTrader 5, built by mladen, that measures how much price has actually moved relative to how wide its own recent trading range has been. It's a free instant download for the MT5 subwindow, and it's designed to answer a specific question: is the market making real directional progress,…
Download the Congestion Index Indicator MT5