OPEN-SOURCE SCRIPT
Telah dikemas kini BTC CME Futures Gaps (BTCGapHunt_CME)

BTC CME Futures Gaps Indicator
Overview
This indicator visualises price gaps between the daily close and open of Bitcoin CME futures (CME:BTC1!). These gaps are often revisited ("filled") by market price action and may serve as technical targets.
Thanks
... to Maven and the Blockchain Masons (x.com/Masons_DAO) to push me on this topic.
What Is a CME Gap?
Key Features
Supported and Overrideable Parameters
How the Gap Size Is Calculated
Visual Guide
Alerts
Recommended Timeframes
How To Use
Notes
Disclaimer
This script is for educational purposes only. Trade at your own risk.
Overview
This indicator visualises price gaps between the daily close and open of Bitcoin CME futures (CME:BTC1!). These gaps are often revisited ("filled") by market price action and may serve as technical targets.
Thanks
... to Maven and the Blockchain Masons (x.com/Masons_DAO) to push me on this topic.
What Is a CME Gap?
- CME Bitcoin Futures do not trade 24/7. Gaps form when the market reopens at a different price than where it last closed.
- Gaps are often used as support/resistance or liquidity targets.
- This indicator tracks, visualises, and alerts on these gaps.
Key Features
- Automatic gap detection using daily open/close on CME:BTC1!
- Dynamic gap size threshold based on ATR (Average True Range)
- Highlight unfilled gaps and track partial fills visually
- Alerts for gap formation and fill events
- Parameter overlay showing real-time settings
Supported and Overrideable Parameters
- ATR Length: Defines the lookback period for ATR calculation (default: 14)
- Gap Size Multiplier: Multiplies the ATR to set the dynamic gap threshold (default: 1.0)
- Proximity Threshold: Price distance from gap edge to consider it filled (default: 100 USD)
- Max Gaps Tracked: Maximum number of concurrent gaps shown (default: 50)
- Alerts Enabled: Toggle alerts for gap formation and gap fill events
How the Gap Size Is Calculated
Minimum Gap Size = ATR(14) * Gap Size Multiplier
- ATR Length and Gap Size Multiplier are configurable.
- Gap threshold adjusts dynamically with market volatility.
Visual Guide
- Red Box: Fully unfilled gap
- Lemon Yellow Box: Partially filled gap
- Right Margin Boxes: Snapshot of unfilled gaps for quick access
- Top-Right Panel: Current ATR, Gap Size, Thresholds, etc.
Alerts
- Gap Formed: A new gap is detected.
- Gap Filled: The gap is either partially or fully filled.
Recommended Timeframes
- 1H, 4H, 1D (best resolution)
- Designed for BTC spot/perpetual charts (e.g., BTCUSD, BTCUSDT)
How To Use
- Add the script to your BTC chart.
- Monitor red/yellow boxes for unfilled gaps.
- Check config panel for current threshold and settings.
- Enable alerts via TradingView for real-time updates.
Notes
- Up to 50 gaps are tracked (adjustable).
- Data source: CME futures via request.security.
- All visuals and alerts are time-synced with your chart.
Disclaimer
This script is for educational purposes only. Trade at your own risk.
Nota Keluaran
Changelog: BTC CME Futures Gaps Indicator (Enhanced)Version Enhancements
- Static Gap Size Option
Users can override ATR-based dynamic gap sizing with a static USD threshold.
New Parameters: Use Static Gap Size (default: false)
Static Gap Size (default: 100 USD) - Improved Visual Filtering
Gaps smaller than 0.01 USD are not shown, both in the chart and right margin. This reduces noise from insignificant gaps. - Robustness Enhancements Safe array access with boundary checks to avoid runtime errors.
Improved cleanup when gaps are removed due to fill or threshold conditions.
Increased stability when processing high bar counts. - Dynamic UI Table Update
Now displays both dynamic (ATR-based) and static gap size values for clarity. - Performance Optimisation
Efficient array handling and early exit conditions improve runtime reliability and reduce overhead.
Impact Summary
- Greater user control over gap sensitivity.
- Cleaner chart visuals with fewer micro-gaps.
- More stable script behaviour under all conditions.
- Better transparency with enhanced parameter display.
Nota Keluaran
Fixed issues on 4h and 1d, enabled by default manual gap size and use 250USD as relevant gap.Nota Keluaran
Bugfix all time dimensionsNota Keluaran
fix: Consistent appearance on 1h, 4h, 1dNota Keluaran
Added far right located boxes to visualiye unfilled gaps in one placeSkrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.