OPEN-SOURCE SCRIPT
已更新 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.
發行說明
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.
發行說明
Fixed issues on 4h and 1d, enabled by default manual gap size and use 250USD as relevant gap.發行說明
Bugfix all time dimensions發行說明
fix: Consistent appearance on 1h, 4h, 1d發行說明
Added far right located boxes to visualiye unfilled gaps in one place開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。