The mfi levels indicator joins two ideas. It builds price levels from repeated swing points. Then it waits for the money flow reading to turn while price sits at one of those levels.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 4: MFI Buy, MFI Sell, MFI Resistance, MFI Support |
| Alerts | popup, push notification, email, sound |
| Inputs | 13 |
What the MFI Levels Indicator draws on the chart
A tomato `MFI Resistance` line tracks the nearest level above price.
A deep sky blue `MFI Support` line tracks the nearest one below.
`MFI Buy` uses arrow 233 and `MFI Sell` uses 234.
Trend objects mark where each level came from.
- MFI Buy: arrow, lime, width 2, arrow code 233
- MFI Sell: arrow, red, width 2, arrow code 234
- MFI Resistance: line, tomato, width 1
- MFI Support: line, deep sky blue, width 1

How the MFI Levels Indicator calculates its values
Levels come from clustered swings
The code walks `InpLookback` `200` bars and collects swing highs and lows. Two points closer than the tolerance merge into one level, and the level moves to their average.
Tolerance scales with range
`InpZoneATRMult` `0.5` times the reading from `InpATRPeriod` `14` sets how close two points must sit to merge. `InpMinTouches` `2` then throws out any level that only formed once.
The reading has to turn there
A buy needs the money flow reading to climb back through `InpOversold` `20.0` while the bar dips to support and closes above it. A sell mirrors that against `InpOverbought` `80.0` at resistance.
How to read the signals
A level with more touches carries more weight, which is what `InpMinTouches` enforces.
The two lines jump when a nearer level takes over.
A mark needs price and the reading to agree on the same bar.
Marks sit twenty points from the candle, a fixed gap rather than a scaled one.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
Three of the routes ship on here, which is unusual. `InpEnableAlerts`, `InpEnablePopup`, `InpEnablePush` and `InpEnableSound` all start true, with `InpSoundFile` naming the clip. Only `InpEnableEmail` begins false. Each closed bar sends at most one message.
Every MFI Levels Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpMFIPeriod |
MFI period. Bars in the money flow reading, default `14`. | 14 |
InpOverbought |
MFI overbought. Upper threshold the reading must cross back under, default `80.0`. | 80.0 |
InpOversold |
MFI oversold. Lower threshold the reading must cross back over, default `20.0`. | 20.0 |
InpLookback |
Lookback bars for level scan. Bars searched for swing points, default `200`. | 200 |
InpMinTouches |
Min touches for a strong level. Touches a level needs before it counts, default `2`. | 2 |
InpZoneATRMult |
Zone tolerance = ATR * mult. Merge tolerance in range units, default `0.5`. | 0.5 |
InpATRPeriod |
ATR period for zone tolerance. Bars in the range average behind that tolerance, default `14`. | 14 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpEnableAlerts |
Master alerts toggle. Gate covering the routes below, default `true`. | on |
InpEnablePopup |
Popup alert. Dialog inside MetaTrader, default `true`. | on |
InpEnablePush |
Push notification. Alert to the mobile app, default `true`. | on |
InpEnableEmail |
Email alert. Message to the terminal mail address, default `false`. | off |
InpEnableSound |
Sound alert. Plays the file named below, default `true`. | on |
InpSoundFile |
Sound file. That file name, default `”alert.wav”`. | alert.wav |

Settings that fit your chart
Levels need repeat visits to mean much. EURUSD H1 is the reference chart, where `InpLookback` `200` reaches back over eight days. On M5 that window covers under a day and levels churn. H4 charts hold a level for weeks.
When the MFI Levels Indicator fails
A level built from two touches is thin evidence, and two is the default.
The merge tolerance moves with range, so the same swings can group differently later.
Two conditions on one bar means quiet weeks with no marks at all.
Copy the compiled MFI Levels Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Background reading on the method behind the MFI Levels Indicator: imfi (MFI) at the MQL5 Documentation, Operating partner on Wikipedia.
Download the MFI Levels Indicator for MT4 and MT5
The zip holds the compiled MFI Levels Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
What does InpMinTouches 2 require?
That a price level formed at least twice before the tool keeps it. One touch is just a swing point. Two makes it a level worth drawing, though it is still thin evidence. Raise it to three for stricter levels.
How does InpZoneATRMult 0.5 group swings?
It sets the merge distance as half the fourteen-bar range reading. Two swing points inside that distance become one level. A wide-ranging session therefore merges points that a quiet session would keep apart.
Does the MFI Buy plot need both conditions?
Yes. The reading has to climb back through `InpOversold` and the bar has to reach support and close above it. Either one alone produces nothing. That pairing is the whole idea behind this build.
Which routes does InpEnablePush cover?
The MetaTrader mobile app, and it ships true here rather than false. `InpEnableSound` also starts on. So out of the box you get a dialog, a phone alert and a sound unless you turn some of them off.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the MFI Levels Indicator as one input. Always backtest before trading live.
Category: this is part of our Support and Resistance collection. Browse more Support and Resistance for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see imfi (MFI) at the MQL5 Documentation.
- For broader market context, see Operating partner on Wikipedia.
