Fair Value Gap Finder
A fair value gap forms across three consecutive candles when the first and third never overlap: the whole of the middle candle's range sits in a strip of price the market jumped over rather than traded through. Because no orders were filled in that strip, traders watch it as a magnet - a place price often returns to before continuing - and as a candidate entry zone when it does. The gap cannot exist, by definition, until the third candle of the triple has closed - there is no way to know the market skipped a range until the candle that would have filled it has finished forming. This indicator only ever marks a gap once that third candle is a confirmed, closed bar. It does not draw anything on the strength of the still-forming bar on the right of the chart. Filling is treated the same way. A zone is only marked filled once a confirmed bar's wick has traded completely through it; testing the still-forming bar would make the fill state flicker back and forth as price moves inside it during the bar, which is its own form of repainting. Once filled, a zone either fades to a neutral colour as a historical reference or disappears outright, depending on preference. Until filled, an active zone's right edge is kept pinned to the current time purely for drawing - that visual stretch is not a signal of any kind. Notes and limitations - A gap only appears after its third candle has closed - this marks a completed imbalance for reference, it is not an early warning that one is forming. - The fill test uses wick extremes (high/low), not the close, so a zone can be marked filled by a single spike even if price closes back outside it. - Carries one calculation-only buffer flagging the bar a new gap formed on; it is not plotted and exists only so the file has a well-formed buffer. - Zone objects are named from the anchor candle's bar time, so reloading history or recompiling never produces duplicate rectangles for the same gap. - Very small gaps on a quiet instrument can be visually cluttered; there is no minimum-size filter in this version.
Indicator · MT5 · v1.0 · Free
About Fair Value Gap Finder
Fair Value Gap Finder is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Alerts, Fade on fill and Bull color. MQL source code included.
Files in the download: FairValueGaps.ex5, FairValueGaps.mq5, FairValueGaps.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Alerts | true | Alert on a new gap (closed bar only) |
| Fade on fill | true | Fade filled zones instead of deleting them |
| Bull color | clrDodgerBlue | Bullish gap zone colour |
| Bear color | clrTomato | Bearish gap zone colour |
| Faded color | clrSilver | Colour a zone turns once filled (fade mode) |
| Fill solid | true | Draw zones as solid rectangles |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Smart Money (SMC / ICT) · Alerts · MT5 Indicator · MQL5 Source Code