New: the Top 10 Non-Repainting MT4 Indicator Pack is free to download

98 free indicators for MetaTrader 4 & 5

Range Expansion Index Indicator MT4

Free MT4 download of Tom DeMark's Range Expansion Index (REI). This oscillator flags overbought/oversold price weakness and strength above/below +/-60. Free download, link emailed in seconds.

MT4Non-repaintingOscillators
Data Windowrange-expansion-index-mt4
PlatformMT4 Build 600+
File.mq4 / .ex4 in .zip
Version1.0
Size2.7 KB
RepaintsNo
TypeOscillators
UpdatedSep 6, 2026
DownloadsNew listing
Download free (2.7 KB)
  • Enter your email, the download link arrives in seconds
  • Free bonus reports on the next page

Indicators are analysis tools, not trade signals. Forex trading on margin carries a high risk of loss. Test on a demo account first.

EURUSD · H4 · previewRange Expansion Index Indicator MT4 v1.0
Range Expansion Index Indicator MT4 on EURUSD H4Non-repainting
How it works →
Overview

This is a free, instant-download MT4 build of Tom DeMark’s Range Expansion Index (REI), a bounded oscillator designed to flag when a market’s range is genuinely expanding versus quietly grinding. Because it’s a DeMark tool built on conditional logic rather than a simple average, it’s worth understanding the actual rule set before you read the plot as a signal.

What It Actually Calculates

REI is built from two rolling sums over an REI_Period-length window (default 8 bars), computed fresh for each bar going back through history:

  • SubValue(i) — takes diff1 = High[i] - High[i+2] and diff2 = Low[i] - Low[i+2], then multiplies that sum by two conditional “zero” flags. The first flag requires that the bar two bars back closed below the closes seven and eight bars back, and that the current bar’s high is below the highs five and six bars back. The second flag runs the mirror-image test using lows. If either condition fails, the whole term is zeroed out for that bar — this is DeMark’s way of only crediting range expansion in the correct directional context.
  • AbsDailyValue(i) — the unconditional, always-positive version: |High[i]-High[i+2]| + |Low[i]-Low[i+2]|.

The indicator sums SubValue and AbsDailyValue independently across the whole REI_Period window, then divides: REI = (sum of SubValue / sum of AbsDailyValue) * 100. Because SubValue can come out positive, negative, or zeroed, the ratio oscillates between roughly -100 and +100, plotted in a separate window with reference levels drawn at +60 and -60.

How to Read the Chart

Per the original DeMark methodology referenced in the indicator’s own comment block: a push above +60 followed by a drop back below +60 signals price weakness (a potential top). A push below -60 followed by a rise back above -60 signals price strength (a potential bottom). The key word is the round trip — DeMark’s method isn’t just “above 60 is overbought,” it’s the crossing back through the level that constitutes the actual signal.

Inputs

  • REI_Period (default 8) — the number of bars used for both the SubValue and AbsDailyValue rolling sums. Smaller values make the oscillator faster and noisier; larger values smooth it out and delay signals.

Why the Conditional Gating Matters

The part that separates REI from a generic range indicator is the pair of zero-out flags inside SubValue(). On any given bar, if the bar two periods back doesn’t qualify as a genuine local extreme relative to bars five, six, seven, and eight periods back, that bar’s contribution to the bullish or bearish sum is multiplied by zero and effectively ignored — even if the raw high/low difference was large. This is what DeMark meant by “range expansion” rather than simple range: a big high-low swing only counts toward REI if it’s happening in a context where the market has actually broken out of its recent structure, not just printed a wide, directionless bar. It’s also why the two num_zero flags are calculated completely independently for the bullish and bearish sides of the formula — a single bar can contribute to neither, one, or (in edge cases) both sides of the SubValue sum, depending on which of the two directional tests it satisfies.

The indicator also sets SetIndexDrawBegin(0, REI_Period + 8), meaning it deliberately withholds plotting until enough history exists to fill the calculation’s full 8-bar lookback offsets (High/Low at i+8) on top of the REI_Period window itself.

Repaint Behavior

REI is non-repainting. The code follows the standard incremental MT4 pattern — it checks IndicatorCounted() and only recalculates bars that haven’t been processed yet, rather than rewriting the whole buffer on every tick. More importantly, both SubValue and AbsDailyValue only ever reference the bar being evaluated plus older bars (offsets of +2, +5, +6, +7, and +8 — all pointing further into the past, never forward). Since none of the inputs to the formula depend on bars that haven’t closed yet, a bar’s REI value is fixed the moment that bar closes and its lookback offsets are all historical.

Limitations

  • The oscillator needs REI_Period + 8 bars of prior history before it starts plotting at all, so it will show gaps at the very start of thin history or brand-new symbols.
  • The signal DeMark describes (cross above/below 60, then cross back) requires you to actually track the crossing sequence yourself — the indicator plots the raw REI value only, with no built-in arrows or alerts for the confirmed cross-back event.
  • Like any range/momentum oscillator, REI can stay pinned near its extremes for extended periods in a strongly trending market, so treat +60/-60 as thresholds to watch for a reversal in the confirming pattern, not as a mechanical fade signal on their own.
  • The indicator plots a single line with no separate arrows, colors, or on-chart labels marking a completed cross-back signal — you’re reading the raw ratio against the fixed +60/-60 reference levels yourself, which means it pairs well with a simple visual scan but has no built-in alert for the DeMark-specific trigger condition.
Range Expansion Index Indicator MT4 on an EURUSD H4 MT4 chart

Range Expansion Index Indicator MT4 on a MetaTrader chart. Click to enlarge.

Repaint verdict: does not repaint. We read the source: every value is calculated on closed bars and never rewritten, so what you see in history is what you would have seen live.

Free pack

Get the Top 10 Non-Repainting Indicator Pack

Ten MT4 indicators that draw on closed bars only, in one zip with install notes for each.

Settings

Inputs, defaults and what they change

  • REI_Period (default 8) — Number of bars used for both the conditional SubValue sum and the unconditional AbsDailyValue sum that make up the REI ratio.
Install

How to install it in MetaTrader 4

  1. Step 1Download and unzip

    Enter your email, open the download link we send you and extract the .mq4 / .ex4 file from the zip.

  2. Step 2Open the data folder

    In MetaTrader, go to File → Open Data Folder.

  3. Step 3Copy into Indicators

    Place the file in MQL4 → Indicators, then restart MetaTrader or refresh the Navigator panel.

  4. Step 4Attach it to a chart

    Find it under Navigator → Indicators and drag it onto any chart.

First time installing an indicator? Watch the 75-second video or follow the screenshots in our MT4 install guide: every click in MetaTrader, plus fixes for an indicator that won't show up.

Free forex calculators
FAQ

Range Expansion Index Indicator MT4 questions

No. It follows the standard IndicatorCounted() incremental calculation pattern and only ever references the current bar plus older, already-closed bars, so a bar’s value is locked in once that bar closes.

It sets the length of the rolling window (default 8 bars) used to sum both the conditional SubValue term and the unconditional AbsDailyValue term that make up the REI ratio.

Per the indicator’s own header comment: a move above 60 that then drops back below 60 signals weakness, and a move below -60 that then rises back above -60 signals strength. The crossing back through the level is the signal, not simply touching it.

REI uses DeMark’s conditional range-expansion logic — comparing today’s high/low against bars 2, 5, 6, 7, and 8 bars back with directional zero-out conditions — rather than a simple average of up/down closes, so its readings reflect qualified range expansion rather than raw price momentum.

Not Specified in the code — there’s no built-in restriction. DeMark’s own default period of 8 bars is intraday-friendly, which is why it’s commonly run on shorter timeframes, but the code itself imposes no such limit.

Range Expansion Index Indicator MT4
Size
2.7 KB
Version
1.0
Repaints
No
Download free
Free packTop 10 Non-Repainting Indicators

Ten closed-bar MT4 indicators in one zip.

Get the pack

Range Expansion Index Indicator MT4Free · 2.7 KB

Download

Where should we email your download link?

Use an email you can check right now: the download link goes straight to this inbox.