OPEN-SOURCE SCRIPT
Gap Map

Gap Map is a price-action mapping tool that identifies true price gaps and tracks them as live zones on the chart.
A true gap is defined as:
* Gap Up: the current open is above the previous bar’s high.
* Gap Down: the current open is below the previous bar’s low.
This means the script does not draw every close-to-open gap. It only maps gaps where the new bar opens completely beyond the previous bar’s range.
1. Core Idea
Price gaps can leave visible areas on the chart where no trading occurred between two consecutive bars.
Gap Map highlights these areas as zones and keeps them active until price fully fills the gap.
The goal is to help users visually track:
* Open true gaps
* Partially filled gaps
* Fully filled gaps
* High-volume gap zones
* Historical fill behavior on the current chart
This is a mapping and analysis tool. It is not a buy/sell indicator and not a trading strategy.
2. What the Indicator Draws
When a valid true gap appears, the script draws a zone between the previous bar’s range and the current open.
For a Gap Up, the zone is drawn between:
Previous high → Current open
For a Gap Down, the zone is drawn between:
Current open → Previous low
The zone remains active until price fully fills the gap.
3. Gap Size Filter
The script includes a minimum gap size filter based on ATR.
Gap size is measured in ATR units:
Gap size / Previous ATR
This helps filter out very small gaps that may not be visually or analytically useful.
Users can reduce the threshold to show more gaps or increase it to focus only on larger gaps.
4. Partial Fill Behavior
The script can optionally shrink a gap zone when price partially fills it.
When this option is enabled, the zone adjusts to show only the remaining unfilled part of the gap.
This helps users see whether a gap is still fully open, partially filled, or already closed.
5. Full Gap Fill
A gap is considered fully filled when price reaches the full-fill level.
For a Gap Up, the gap is filled when price trades back to the previous high.
For a Gap Down, the gap is filled when price trades back to the previous low.
Filled zones can either be removed from the chart or kept as faded historical zones, depending on the user’s settings.
6. High-Volume Gaps
The script compares the gap bar’s volume with its average volume.
If the gap appears with volume above the selected relative-volume threshold, it is marked with a highlighted border.
These high-volume gaps are treated as breakaway candidates for review.
This does not mean the gap cannot fill. It only means the gap occurred with stronger-than-usual volume and may deserve additional attention.
7. Optional Statistics Table
The optional statistics table summarizes gap behavior on the current chart.
It can show:
* Number of true gap-up zones
* Number of true gap-down zones
* Percentage filled so far
* Median bars to fill
* Number of open gaps now
* High-volume gap fill statistics
The table is intended as historical context for the current symbol and timeframe.
It should not be interpreted as a forecast that future gaps must behave the same way.
8. How to Use
A practical workflow:
1. Add the indicator to a clean chart.
2. Keep the default ATR filter first.
3. Review open gap zones.
4. Check whether price is approaching a gap zone.
5. Use partial-fill behavior to monitor how much of the gap remains open.
6. Turn on the statistics table if you want historical fill context.
7. Combine the gap map with trend, volume, support/resistance, and broader market context.
8. Best Use Cases
Gap Map is most useful for markets that can create real gaps, such as:
* Stocks
* ETFs
* Indices
* Session-based futures
* Markets with clear open/close sessions
It is less meaningful on continuously traded markets where true session gaps are rare.
10. Important Notes
This script maps true gaps only.
It does not draw every close-to-open difference.
It does not predict that a gap must fill.
It does not provide entry or exit signals.
It does not measure order flow.
It does not execute trades.
High-volume gap highlighting is for visual review only, not a confirmation of direction.
11. Alerts
The script includes alert conditions for:
* New true gap up
* New true gap down
* Gap filled
Alerts are informational only. They do not confirm future price movement.
12. Limitations
Gap behavior can vary by symbol, timeframe, volatility regime, market structure, earnings events, news events, and liquidity conditions.
A gap zone can remain open for a long time.
A gap can be partially filled and then price can continue in the original direction.
Large high-volume gaps may behave differently from small low-volume gaps.
Historical fill statistics are calculated from the current chart’s own history and should be treated as context, not a guarantee.
13. Educational Disclaimer
This script is for educational and chart-analysis purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Users are responsible for their own analysis, risk management, and trading decisions.
A true gap is defined as:
* Gap Up: the current open is above the previous bar’s high.
* Gap Down: the current open is below the previous bar’s low.
This means the script does not draw every close-to-open gap. It only maps gaps where the new bar opens completely beyond the previous bar’s range.
1. Core Idea
Price gaps can leave visible areas on the chart where no trading occurred between two consecutive bars.
Gap Map highlights these areas as zones and keeps them active until price fully fills the gap.
The goal is to help users visually track:
* Open true gaps
* Partially filled gaps
* Fully filled gaps
* High-volume gap zones
* Historical fill behavior on the current chart
This is a mapping and analysis tool. It is not a buy/sell indicator and not a trading strategy.
2. What the Indicator Draws
When a valid true gap appears, the script draws a zone between the previous bar’s range and the current open.
For a Gap Up, the zone is drawn between:
Previous high → Current open
For a Gap Down, the zone is drawn between:
Current open → Previous low
The zone remains active until price fully fills the gap.
3. Gap Size Filter
The script includes a minimum gap size filter based on ATR.
Gap size is measured in ATR units:
Gap size / Previous ATR
This helps filter out very small gaps that may not be visually or analytically useful.
Users can reduce the threshold to show more gaps or increase it to focus only on larger gaps.
4. Partial Fill Behavior
The script can optionally shrink a gap zone when price partially fills it.
When this option is enabled, the zone adjusts to show only the remaining unfilled part of the gap.
This helps users see whether a gap is still fully open, partially filled, or already closed.
5. Full Gap Fill
A gap is considered fully filled when price reaches the full-fill level.
For a Gap Up, the gap is filled when price trades back to the previous high.
For a Gap Down, the gap is filled when price trades back to the previous low.
Filled zones can either be removed from the chart or kept as faded historical zones, depending on the user’s settings.
6. High-Volume Gaps
The script compares the gap bar’s volume with its average volume.
If the gap appears with volume above the selected relative-volume threshold, it is marked with a highlighted border.
These high-volume gaps are treated as breakaway candidates for review.
This does not mean the gap cannot fill. It only means the gap occurred with stronger-than-usual volume and may deserve additional attention.
7. Optional Statistics Table
The optional statistics table summarizes gap behavior on the current chart.
It can show:
* Number of true gap-up zones
* Number of true gap-down zones
* Percentage filled so far
* Median bars to fill
* Number of open gaps now
* High-volume gap fill statistics
The table is intended as historical context for the current symbol and timeframe.
It should not be interpreted as a forecast that future gaps must behave the same way.
8. How to Use
A practical workflow:
1. Add the indicator to a clean chart.
2. Keep the default ATR filter first.
3. Review open gap zones.
4. Check whether price is approaching a gap zone.
5. Use partial-fill behavior to monitor how much of the gap remains open.
6. Turn on the statistics table if you want historical fill context.
7. Combine the gap map with trend, volume, support/resistance, and broader market context.
8. Best Use Cases
Gap Map is most useful for markets that can create real gaps, such as:
* Stocks
* ETFs
* Indices
* Session-based futures
* Markets with clear open/close sessions
It is less meaningful on continuously traded markets where true session gaps are rare.
10. Important Notes
This script maps true gaps only.
It does not draw every close-to-open difference.
It does not predict that a gap must fill.
It does not provide entry or exit signals.
It does not measure order flow.
It does not execute trades.
High-volume gap highlighting is for visual review only, not a confirmation of direction.
11. Alerts
The script includes alert conditions for:
* New true gap up
* New true gap down
* Gap filled
Alerts are informational only. They do not confirm future price movement.
12. Limitations
Gap behavior can vary by symbol, timeframe, volatility regime, market structure, earnings events, news events, and liquidity conditions.
A gap zone can remain open for a long time.
A gap can be partially filled and then price can continue in the original direction.
Large high-volume gaps may behave differently from small low-volume gaps.
Historical fill statistics are calculated from the current chart’s own history and should be treated as context, not a guarantee.
13. Educational Disclaimer
This script is for educational and chart-analysis purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Users are responsible for their own analysis, risk management, and trading decisions.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.