Free learning tools Test your finance and trading knowledge before you build, buy, or automate.

AlgoSpecial_ImbalanceZoneX — The Complete Technical Guide to Fair Value Gaps on MetaTrader 5

Product: AlgoSpecial_ImbalanceZoneX v2.00 · MT5 Indicator · Pure MQL5
Trial: valid until 05 January 2027 · Full version: $80 — algospecial.com or t.me/bullionstrategy
Keywords: MT5 fair value gap indicator, FVG indicator MT5, price imbalance indicator, ICT fair value gap, smart money concepts indicator, imbalance zone MT5, liquidity void indicator, non-repainting FVG.
AlgoSpecial ImbalanceZoneX input parameters
AlgoSpecial ImbalanceZoneX input parameters
AlgoSpecial ImbalanceZoneX chart with fair value gap boxes
AlgoSpecial ImbalanceZoneX chart with fair value gap boxes

Why most traders read fair value gaps wrong

Ask ten traders what a fair value gap is and you will get ten versions of "a gap between candles." That definition is not wrong — it is just incomplete. A fair value gap is not a shape on a chart; it is the fingerprint of an order-flow imbalance. It is the residue left behind when aggressive, one-sided order flow moves price so fast that the opposite side of the book never gets filled at those prices. The market is an auction, and an auction that skips a price band leaves unfinished business behind. AlgoSpecial_ImbalanceZoneX exists to make that unfinished business visible, measurable, and tradable on MetaTrader 5 — without repainting, without lag, and without depending on any external service.

This guide is the deep technical companion to the indicator. It explains the auction theory behind imbalances, the exact detection logic inside the engine, every input parameter, how to read the chart, and how to build a repeatable trading playbook around the boxes — on forex, gold, indices, and crypto.

1. Auction theory: why an imbalance must be revisited

Modern markets are continuous double auctions. Buyers and sellers post limit orders that form the order book, and market orders consume the best available prices. When supply and demand are roughly balanced, price moves in small steps and every price is traded. When demand overwhelms supply, market buys "sweep" through multiple price levels faster than new sell limit orders arrive. The result is a vertical candle with almost no overlap against its neighbours — and a band of prices that were technically printed but never auctioned.

That band is the imbalance. Because no meaningful two-sided trade occurred there, the market has no memory of "fair value" inside it. Auction theory — the same framework behind Market Profile and volume profile — says that markets seek to facilitate trade, so price is drawn back to unfinished auction areas to "rebalance" them. This is why fair value gaps behave like magnets: not magic, but the mechanics of a market completing its book.

There are three practical consequences that AlgoSpecial_ImbalanceZoneX encodes directly:

  1. Displacement matters more than the gap. A gap created by a slow drift is noise; a gap created by explosive displacement is institutional. The engine therefore cares about the impulse, not just the geometry.
  2. A gap is a zone, not a line. The midpoint and the two edges behave differently. Some traders want the deep edge (best price, lowest fill probability); others want the near edge (fastest fill). The indicator lets you choose.
  3. Mitigation changes the meaning. Once price trades back through the zone, the imbalance is "rebalanced" — it is no longer a magnet, and its colour should change so you stop treating it as fresh.

2. What a three-candle fair value gap actually is

The strict, mechanical definition — and the one AlgoSpecial_ImbalanceZoneX implements — uses three consecutive candles:

Everything else — the "gap" people draw by hand — is a looser approximation. The three-candle form is preferred because it is objective: two independent time points (candle 1 and candle 3) bracket a displacement candle, and the gap exists only if there is genuine non-overlap. This objectivity is what allows the indicator to run identically on every symbol and timeframe without a human deciding whether a gap "counts."

3. Inside the AlgoSpecial engine: how ImbalanceZoneX works

AlgoSpecial_ImbalanceZoneX is written in pure MQL5 with zero DLLs and zero WebRequest calls, so it runs fully offline and never depends on the terminal's built-in indicators. The engine is event-driven and evaluates only closed bars, which is the reason the indicator does not repaint: a box, once drawn, describes a completed candle and cannot change.

The processing loop on each new bar is:

  1. Mitigation sweep. For every still-active gap, the engine checks whether the newly closed bar traded through the zone (`low[i] <= gapTop && high[i] >= gapBottom`). If it did, the gap is marked mitigated and its right edge is frozen at the mitigation bar.
  2. Detection. The engine tests the last three closed candles for a new bullish or bearish gap. If one exists, it measures the gap size in broker points.
  3. Quality filter. If the measured gap is smaller than your Minimum Gap Size, it is discarded — this is the single most important noise filter, because tiny gaps clutter the chart and rarely hold.
  4. Drawing. A rectangle is created from the middle candle's time to the live right edge, tagged with a unique object name prefixed `AS_FVG_`, and coloured bullish or bearish.
  5. Live extension. On every tick, still-active gaps have their right edge pushed forward to the current bar, so the box "follows" price until it is filled. This is what makes an unmitigated gap look alive and a mitigated one look frozen.
  6. Bounding. When the number of tracked gaps exceeds Maximum Gaps Kept on Chart, the oldest is removed and its object deleted, keeping the chart and memory bounded even on long histories.

Because detection happens on the close of candle 3 and never re-evaluates a closed pattern, the historical record is stable — a property that matters enormously for backtesting and for trusting the tool live.

4. Every input parameter, explained

The inputs are grouped exactly as you see them in the AlgoSpecial input dialog (see the screenshot above).

Detection Settings

Mitigation Behavior

Box Style

Extras

5. Reading the chart

In the chart screenshot above, bullish gaps are the cyan boxes and bearish gaps the red boxes. Notice three things that define the tool's value:

  1. Live vs frozen. The right edge that keeps moving belongs to an unmitigated gap; the edge that stops at a specific candle belongs to a mitigated one. That single visual tells you whether an imbalance is still "in play."
  2. Depth of the zone. The box height is the imbalance size. Deep boxes are strong displacement; shallow boxes are marginal and can be ignored if you raise the minimum gap filter.
  3. Sequence and stacking. When two or three gaps stack in the same direction, you are looking at institutional accumulation or distribution — a higher-probability context than an isolated gap.

6. The trading playbook: turning gaps into decisions

A fair value gap is a location, not a signal. The professional use is confluence:

A disciplined rule set: only trade gaps in the direction of the higher-timeframe trend, require the gap to be above your minimum size, and require at least one structural reason (sweep, divergence, or key level) beyond the gap itself.

7. Instruments and timeframes

ImbalanceZoneX is symbol-agnostic. It performs best where displacement is clean: forex majors and crosses (EURUSD, GBPUSD, USDJPY, GBPJPY), gold (XAUUSD — where imbalances are frequent and strong), indices (US100, US30, GER40) and crypto (BTCUSD, ETHUSD). M5–H4 is the sweet spot for intraday; H1–D1 for swing context. On very low timeframes, raise the minimum gap size to avoid noise.

8. Risk and prop-firm notes

Because the tool is non-repainting and marks mitigation objectively, it is safe to use inside a rules-based plan — which is what prop firms care about. Combine gaps with a fixed stop beyond the sweep extreme, a minimum reward-to-risk of 1:2, and a per-trade risk cap. The indicator itself never trades; it informs a plan that you (or an EA) execute.

9. Installation

  1. Copy `AlgoSpecial_ImbalanceZoneX.ex5` into `MQL5\Indicators\` in your MT5 data folder.
  2. Refresh the Navigator, drag the indicator onto a chart.
  3. Load the included `AlgoSpecial_ImbalanceZoneX.set` from the Inputs tab to start from the tested defaults.
  4. Tune the minimum gap size to your symbol and timeframe.

10. Download

The compiled EX5 and the ready SET preset are free to download, with a trial valid until 05 January 2027. The full version is $80 — contact algospecial.com or t.me/bullionstrategy.

11. Advanced: scoring displacement and grading gap quality

Not all fair value gaps are equal, and the traders who make money from them are the ones who rank them. Three variables let you grade a gap before you trade it:

Displacement strength. The middle candle is the tell. Measure its body relative to the recent ATR. A displacement candle whose body exceeds roughly 1.0–1.5× ATR is an institutional move; a gap formed by a gentle drift is retail noise. AlgoSpecial_ImbalanceZoneX gives you the gap size in points, and you can cross-check displacement with the ATR regime from your other tools. The rule is simple: the bigger the displacement, the more likely the gap holds as support/resistance when price returns.

Gap depth and time. Deep gaps (many points) take longer to fill but offer more room; shallow gaps fill quickly but give little edge. There is a sweet spot for every instrument and timeframe. On XAUUSD M5, gaps of 30–80 points behave differently from gaps of 200+ points; on EURUSD M15 the meaningful range is much tighter. Log which gap sizes actually produce reactions on your symbol and set `Minimum Gap Size` to that threshold.

Freshness. A gap that has just formed and has not been touched is "live." The moment price enters it, you are watching the auction rebalance in real time — that is the highest-information moment to be positioned or ready. A gap that has already been half-filled has spent part of its energy. AlgoSpecial_ImbalanceZoneX encodes this visually: live boxes extend, mitigated boxes freeze and grey out.

12. The multi-timeframe FVG stack

The single most under-used technique with fair value gaps is to treat them across timeframes. A higher-timeframe gap (H4 or D1) is a target; a lower-timeframe gap (M5 or M15) is an entry. When price is travelling toward an unfilled H4 bullish gap, you use M5 gaps as the trigger to join the move in the higher-timeframe direction. When the higher-timeframe gap fills, that is your profit-taking zone, not your entry.

Build the stack like this:

  1. Confirm bias with AlgoSpecial_TrendMatrixPro (H1/H4/D1 aligned).
  2. Identify the unfilled higher-timeframe gap as the objective.
  3. Wait for a lower-timeframe gap in the direction of travel after a pullback.
  4. Enter on the lower-timeframe gap with a stop beyond the pullback extreme.

This converts a simple indicator into a complete top-down workflow, and it is the reason the AlgoSpecial indicator family is designed to work as a set rather than as isolated tools.

13. Parameter tuning matrix

There is no single "best" setting; there is a best setting per instrument and timeframe. The table below is a practical starting matrix based on how displacement behaves on each market:

InstrumentTimeframeMinimum Gap Size (points)Max GapsEntry mode
EURUSD / GBPUSDM1540–8040Midpoint
USDJPY / GBPJPYM1560–12040Midpoint
XAUUSD (gold)M550–12050Deep edge
XAUUSD (gold)M15120–30050Midpoint
US100 / US30M5100–25040Midpoint
BTCUSDM15300–80030Deep edge

Start with these, then adjust by watching how often your gaps produce a reaction versus how often they get filled immediately. If most gaps are ignored, raise the minimum size; if you see too few, lower it.

14. Common mistakes (and how the indicator prevents them)

  1. Trading every gap. The most common error. Fix: raise `Minimum Gap Size` and require a structural reason (trend, sweep, level).
  2. Treating a mitigated gap as live. Once the auction is complete, the magnet is gone. Fix: colour-code mitigation (default on) and never target greyed gaps.
  3. Fading displacement. Buying into a bearish gap during a strong downtrend is fighting institutional flow. Fix: gate every gap entry with the TrendMatrixPro bias.
  4. Ignoring the higher-timeframe gap. The HTF gap is the destination; entering on a random LTF gap without one is low-probability. Fix: use the MTF stack described above.
  5. Over-cluttering the chart. Hundreds of boxes paralyse decision-making. Fix: cap `Max Gaps` and hide mitigated gaps when you want a clean view.

15. Backtesting and forward-testing notes

Because AlgoSpecial_ImbalanceZoneX is non-repainting and evaluates only closed bars, the historical boxes you see are exactly the boxes you would have seen live — which makes visual backtesting honest. When you review history, ask three questions for every gap: did price respect it (react), sweep through it (fail), or ignore it (drift)? Log the answers by instrument and timeframe. Within a few hundred gaps you will have a personal, evidence-based `Minimum Gap Size` for each market — a far more valuable asset than any default setting.

FAQ

Is AlgoSpecial_ImbalanceZoneX a free MT5 fair value gap indicator? Yes — the compiled `.ex5` and `.set` are free, with a trial running until 05 January 2027.

Does it repaint? No. Detection and mitigation are evaluated on closed bars, so historical boxes never change.

What is the difference between a fair value gap and an order block? An order block is the last opposing candle before displacement; a fair value gap is the untraded band created by that displacement. They often coincide and are best used together.

Can it run on any symbol? Yes — forex, XAUUSD/gold, indices, crypto and CFDs.

Does it alert me when a gap forms? Yes, enable "Popup Alert When a New Gap Is Detected."

Can I hide mitigated gaps? Yes — enable "Delete a Gap's Box Once Mitigated."

Which timeframe is best? M5–H4 for intraday, H1–D1 for swing; raise the minimum gap size on low timeframes.

Does it need internet or Python? No — it is pure MQL5 and runs entirely offline.

Can I use it with the AlgoSpecial indicators? Yes — it is designed to be the entry-timing layer of a stack that includes TrendMatrixPro (bias), LevelHunterPro (levels) and DivergenceRadar (momentum).

Risk disclaimer: this indicator is educational trading software, not investment advice and not a promise of profit. Test on demo first. See algospecial.com for the full disclaimer.

Free Download

The compiled MT5 indicator and the ready preset are free to download. Trial valid until 05 January 2027. The MQL5 source is not included; the full version is $80.

🚀 Invite friends — Earn $5 You both get $5 credit on Go Ad · opencode.ai AI-Powered Coding Agent — Try Free Build apps, fix bugs & ship faster with opencode. Get $5 free credit when you join. × Ad · quo.com QuoPhone — $20 Visa Gift Card Free Sign up to Quo, subscribe 3 months, get a $20 Visa gift card. Atif's referral gift for you. ×