OPEN-SOURCE SCRIPT
Gap Zones - Daily & Intraday (v9)

Gap Zones (wick-fill, custom colors, hide filled)
What’s new
• Wick-based gap fills
• A gap is now considered filled as soon as the price wick touches the far edge of the gap.
• Gap up → filled when low ≤ lower edge.
• Gap down → filled when high ≥ upper edge.
• Custom colors & transparency
• New inputs:
• Gap Up Color
• Gap Down Color
• Gap Fill Transparency
• Lets you style bullish / bearish gaps and adjust how strong the zones appear on the chart.
• Hide filled gaps (optional)
• New toggle: Hide Gaps Once Filled.
• When ON, lines and fills are deleted as soon as the gap is filled.
• When OFF, gaps stop extending and are faded out (colors set to na).
• Daily + Intraday modes preserved
• Gap Mode still supports both:
• "Daily" → gaps between daily candles (using higher-timeframe data).
• "Intraday Bars" → gaps between consecutive intraday bars.
Stability / bug fixes
• Fixed all line.new() and label.new() syntax issues by keeping function calls on a single line.
• Added a safety guard so the script doesn’t try to read from empty arrays on the first bar (if count > 0).
• Cleaned up the gap detection logic so there are no ta.change() warnings.
What’s new
• Wick-based gap fills
• A gap is now considered filled as soon as the price wick touches the far edge of the gap.
• Gap up → filled when low ≤ lower edge.
• Gap down → filled when high ≥ upper edge.
• Custom colors & transparency
• New inputs:
• Gap Up Color
• Gap Down Color
• Gap Fill Transparency
• Lets you style bullish / bearish gaps and adjust how strong the zones appear on the chart.
• Hide filled gaps (optional)
• New toggle: Hide Gaps Once Filled.
• When ON, lines and fills are deleted as soon as the gap is filled.
• When OFF, gaps stop extending and are faded out (colors set to na).
• Daily + Intraday modes preserved
• Gap Mode still supports both:
• "Daily" → gaps between daily candles (using higher-timeframe data).
• "Intraday Bars" → gaps between consecutive intraday bars.
Stability / bug fixes
• Fixed all line.new() and label.new() syntax issues by keeping function calls on a single line.
• Added a safety guard so the script doesn’t try to read from empty arrays on the first bar (if count > 0).
• Cleaned up the gap detection logic so there are no ta.change() warnings.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.