The fair value gaps mitigation oscillator indicator turns a smart-money idea into a number. It finds every three-candle imbalance inside `InpLookback` bars, checks which ones price has since traded back through, and reports the unfilled share as a reading between 0 and 100.
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 | Separate window (levels 20 / 50 / 80) |
| Plots | 3: Mitigation %, BuyArrow, SellArrow |
| Alerts | popup |
| Inputs | 4 |
What the build actually draws
Mitigation % is the dodger blue line in its own pane.
BuyArrow and SellArrow mark crossings of the two threshold levels.
Reference lines sit at 20, 50 and 80.
The pane is bounded, so a reading of 100 means nothing has been filled.
- Mitigation %: line, dodger blue, width 2
- BuyArrow: arrow, lime, width 2, arrow code 233
- SellArrow: arrow, red, width 2, arrow code 234

What the file computes
Finding the gaps
A bullish gap exists when the low of one candle still sits above the high of the candle two positions earlier. The bearish case mirrors it. Both leave a band of prices the market skipped.
Checking what filled
For each gap the code walks later bars looking for one whose range overlaps the band. A single touch counts as filled. Everything else stays in the unfilled tally.
Turning it into a percentage
osc takes 100 times unfilled over total. So a reading of 80 means four fifths of the gaps in the window remain untouched. `InpLookback` `50` bounds the whole count.
Getting a signal from it
A high reading means the market has been leaving imbalances behind.
A falling reading means price has been going back to fill them.
Above `InpHighLevel` `80.0` the code reads the state as continuation.
Below `InpLowLevel` `20.0` it reads the state as a reversal condition.
Alert channels in this build: popup, one message per closed bar.
`InpAlerts` ships on and raises a terminal popup when the reading crosses either threshold. This build carries no push, email or sound channel. The guard permits one message per closed bar.
Every Fair Value Gaps Mitigation Oscillator Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpLookback |
Lookback bars (count FVG fills). Bars the gap count covers, default `50`. | 50 |
InpHighLevel |
Continuation threshold. Continuation threshold, default `80.0`. | 80.0 |
InpLowLevel |
Reversal threshold. Reversal threshold, default `20.0`. | 20.0 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpAlerts |
Alerts on crosses. Popup on a threshold crossing, default `true`. | on |

Picking a chart for it
Three-candle gaps need bars with real ranges. EURUSD H1 is the reference chart, where `InpLookback` at `50` covers two days. On M5 gaps form and fill within the hour, so the reading swings fast. On H4 an unfilled gap can sit for weeks.
What it handles badly
A single touch counts a gap as filled, however briefly price visited it.
The reading depends entirely on how many gaps the window happens to contain.
Labelling 80 as continuation and 20 as reversal is a convention, not a finding.
Copy the compiled Fair Value Gaps Mitigation Oscillator 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 Fair Value Gaps Mitigation Oscillator Indicator: Market value on Wikipedia, Gaps And Gap Analysis at StockCharts ChartSchool.
Download the Fair Value Gaps Mitigation Oscillator Indicator for MT4 and MT5
The zip holds the compiled Fair Value Gaps Mitigation Oscillator 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 InpLookback count as a filled gap?
Any later bar whose range overlaps the gap band, even briefly. That is a loose definition on purpose, since a gap price has touched is no longer untraded. Some traders would want a full close through it instead.
What does InpLookback at 50 bound?
The whole count. Only gaps inside the last fifty bars appear in the tally, filled or not. Widen it and the reading becomes steadier, because a single new gap changes a larger denominator less.
Why does the Mitigation % line jump?
Because the denominator is small. With only a handful of gaps in the window, one filling can move the reading by twenty points. That is inherent to a count-based measure over a short lookback.
Are InpHighLevel and InpLowLevel meaningful?
They are conventions rather than findings. The code treats a reading above `InpHighLevel` `80.0` as continuation and below `InpLowLevel` `20.0` as a reversal condition. Both are labels you can move to suit your own reading.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Fair Value Gaps Mitigation Oscillator Indicator as one input. Always backtest before trading live.
Category: this is part of our Oscillators collection. Also, truly, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in Market value on Wikipedia.
- Additional market context is at Gaps And Gap Analysis at StockCharts ChartSchool.
