Gap Fill TrackerGap Fill Tracker
The Gap Fill Tracker is an overlay indicator that automatically detects, tracks, and measures the fill rate of price gaps — defined as the difference between the previous candle's close and the current candle's open. It counts a gap as filled when price reaches the 50% midpoint of the gap range, and provides a live statistics panel including total gaps detected, fill rate percentage, open gaps, and the average time gaps take to fill expressed in human-readable time units adapted to the current chart timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT IS A GAP?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A gap occurs when a candle opens at a different price than the previous candle's close, leaving an unfilled zone on the chart. Bullish gaps open above the prior close. Bearish gaps open below the prior close. Gaps can occur on any timeframe and any instrument, and they represent price imbalances — zones where no trading occurred, which the market tends to revisit.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FILL CONDITION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A gap is considered filled when price touches the 50% midpoint of the gap range — not necessarily the full extent. This is a more conservative and statistically accurate measure than requiring a full gap fill, as it captures the point at which the market has revisited the center of the imbalance. The midpoint is marked on the chart as a dashed line through the middle of each open gap zone.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPONENTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Gap Zones (boxes)
Each detected gap is visualized as a colored rectangle spanning from the gap's lower boundary to its upper boundary, starting at the bar where the gap occurred and extending to the right. Bullish gaps are displayed in teal. Bearish gaps are displayed in pink. Zones disappear silently when the fill condition is met — no confirmation markers are left on the chart, keeping it clean.
2. Midpoint Line (dashed)
A dashed horizontal line runs through the center of each open gap zone, marking the exact price level that constitutes a fill. This is the target level the indicator monitors.
3. Gap Labels
Small labels mark the bar where each gap was detected, indicating direction (GAP ↑ for bullish, GAP ↓ for bearish).
4. Statistics Table (top right)
A compact panel displays four key metrics updated in real time:
- Detected: total number of gaps found in the chart's history
- Filled: number of gaps that reached the 50% midpoint, with fill rate percentage
- Open: number of gaps still unfilled, with open rate percentage
- Avg fill time: average time gaps take to reach the 50% midpoint, expressed automatically in minutes, hours, days, or weeks depending on the chart timeframe
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Minimum gap (%): The minimum size of a gap expressed as a percentage of the prior close, to filter out micro-gaps caused by spread or rounding. Default is 0.5%. Lower values detect more gaps; higher values focus only on significant gaps.
• Max open gaps visible: Controls how many of the most recent unfilled gaps are displayed on the chart. Older open gaps continue to count in the statistics but are hidden visually to keep the chart readable. Default is 10.
• Show open zones: Toggle the visual display of open gap zones on or off. Statistics continue to update regardless.
• Bull/Bear gap colors: Customize the colors for bullish and bearish gap zones independently.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO INTERPRET IT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FILL RATE
The fill rate shown in the statistics panel tells you what percentage of historical gaps on this instrument and timeframe have been filled. A fill rate above 95% confirms that gap fills are a near-certain statistical event for this market. A lower fill rate suggests that the instrument or timeframe has structural tendencies that prevent consistent gap fills — for example, strongly trending markets on higher timeframes.
OPEN GAPS
Each visible zone on the chart represents an active price target — a level where the market has a strong statistical tendency to return. The more open gaps accumulated above or below current price, the stronger the magnetic pull toward those levels.
MIDPOINT LINE
The dashed line through each zone is the exact fill target. Price touching this level — even with a wick — constitutes a fill and removes the zone from the chart.
AVERAGE FILL TIME
This is the most operationally useful metric. It tells you how long gaps on this instrument and timeframe typically take to fill, expressed in real time units. If the average fill time on a 4-hour chart is 1.1 weeks, that means most gaps are filled within approximately 1 to 2 weeks of forming. This information can be used to time entries — rather than entering immediately after a gap forms, waiting until price approaches the average fill window increases the probability of catching the fill move at the right moment.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. CHECK THE FILL RATE FIRST
Load the indicator on your instrument and timeframe of choice. Check the fill rate in the statistics panel. If it is above 95%, gap fills are a reliable statistical edge on that market. If it is significantly lower, adjust the minimum gap size or consider a different timeframe.
2. IDENTIFY OPEN GAPS AS PRICE TARGETS
The visible zones on the chart are active price targets. Open gaps above current price are upside targets. Open gaps below current price are downside targets. The midpoint line is the specific price level to watch.
3. USE THE AVERAGE FILL TIME FOR ENTRY TIMING
Note the average fill time displayed in the table. After a gap forms, use this as a reference for when to start looking for an entry toward the fill. If the average fill time is 1 week on a daily chart, the highest probability entry window is typically in the days surrounding that average, not immediately after the gap opens.
4. MANAGE THE TRADE
The target is the midpoint of the gap. Once price touches the midpoint, the zone disappears automatically. Position sizing, stop placement, and exit management are left to the trader's discretion and should be based on their own risk framework.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Works on any instrument and any timeframe. Fill rates and average fill times vary by market and timeframe — always verify the statistics panel before trading.
• The average fill time automatically adapts to the chart's timeframe: it displays in minutes on intraday charts, hours on hourly charts, days on daily charts, and weeks on weekly charts.
• Filled gaps disappear silently without leaving markers on the chart, ensuring a clean visual at all times.
• The statistics counter covers the full available chart history, not just the visible bars on screen.
• For instruments that trade 24/5 (forex) or 24/7 (crypto), the average fill time reflects calendar time based on bar count times timeframe minutes. For instruments with trading sessions (equities, futures), the actual calendar time will be longer since no bars are generated outside market hours.
อินดิเคเตอร์ Pine Script®






















