OPEN-SOURCE SCRIPT
Aggiornato 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.
Note di rilascio
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.
Note di rilascio
Fixed issues on 4h and 1d, enabled by default manual gap size and use 250USD as relevant gap.Note di rilascio
Bugfix all time dimensionsNote di rilascio
fix: Consistent appearance on 1h, 4h, 1dNote di rilascio
Added far right located boxes to visualiye unfilled gaps in one placeScript open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.