OPEN-SOURCE SCRIPT
Aktualisiert 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.
Versionshinweise
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.
Versionshinweise
Fixed issues on 4h and 1d, enabled by default manual gap size and use 250USD as relevant gap.Versionshinweise
Bugfix all time dimensionsVersionshinweise
fix: Consistent appearance on 1h, 4h, 1dVersionshinweise
Added far right located boxes to visualiye unfilled gaps in one placeOpen-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.