Loading…

Unfilled Gap Registry

Most gap indicators mark a gap once and leave the trader to track by eye whether and how much of it has since been filled. This one keeps a running registry: every gap above a minimum size gets its own rectangle, its own age counter, and its own fill percentage, all updated live as price moves. A gap's fill percentage is measured the way price actually closes a gap - by how far the opposite side of the range has been reclaimed, not by whether the gap's midpoint has been touched. An upward gap fills as the low comes back down into it; a downward gap fills as the high comes back up into it. Once that intrusion reaches the far edge, the gap is marked fully filled, its box either fades to a neutral colour as a historical record or disappears outright, depending on preference. The registry keeps a bounded number of gaps at once. When the limit is reached, the oldest still-open gap is dropped to make room for a new one - old, forgotten gaps are the least useful ones to keep cluttering the chart, and a hard cap keeps object counts predictable no matter how long the indicator has been attached. Notes and limitations - A gap is detected purely from this chart's own bar-to-bar open/close jump. On an intraday timeframe that means it flags any feed jump large enough to qualify, not only the classic weekend gap - this is deliberate, since the same "does it get filled" question applies to any gap, but it means a busy news feed can register more gaps on a lower timeframe than a trader expects. - Fill percentage is measured against confirmed and forming bar extremes (high/low), so it can jump straight to 100% on a single large wick rather than climbing gradually. - The registry has no memory across terminal restarts; gaps already filled before the indicator was ever attached are not reconstructed retroactively beyond what the currently loaded chart history shows. - A hard cap on tracked gaps means a very gap-prone symbol or a very low InpMinGapPips setting can silently drop the oldest open gap before it fills, rather than growing the registry without bound.

Indicator · MT4 · v1.0 · Free

About Unfilled Gap Registry

Unfilled Gap Registry is an indicator for MetaTrader 4. It has 7 settings, such as Min gap pips, Max tracked and Fade on fill. MQL source code included.

Files in the download: UnfilledGapRegistry.mq4, UnfilledGapRegistry.txt.

Settings

SettingDefaultWhat it does
Min gap pips5.0Smallest gap worth registering, in pips
Max tracked50Maximum open gaps tracked at once (oldest dropped first)
Fade on filltrueFade filled boxes instead of deleting them
Up colorclrDodgerBlueBox colour for an up gap (open above prior close)
Down colorclrTomatoBox colour for a down gap (open below prior close)
Filled colorclrSilverBox colour once a gap is fully filled
Show labelstrueShow age / fill-percentage text on each box

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria