OPEN-SOURCE SCRIPT
Gap Detector

Gap Detector — Multi-Timeframe Price Gap Scanner
Automatically detects and visualizes all price gaps across any timeframe — Daily, Weekly, Monthly, or Intraday.
📊 What It Does
This indicator identifies true price gaps where the current candle opens completely above (gap up) or below (gap down) the previous candle's range, with no price overlap between them.
Gap Up (Bullish): Current candle's low > Previous candle's high
Gap Down (Bearish): Current candle's high < Previous candle's low
✨ Key Features
✅ Auto-Detects Chart Timeframe — Works on any timeframe without manual selection (1min, 5min, 1H, 4H, Daily, Weekly, Monthly)
✅ Visual Gap Boxes — Green boxes for gap ups, red boxes for gap downs, drawn exactly across the gap zone
✅ Gap Size Labels — Shows gap percentage on each box for quick assessment
✅ Customizable Filters — Set minimum and maximum gap size % to filter noise
✅ Summary Statistics Table — Live count of bull gaps, bear gaps, and total gaps detected
✅ Pine Screener Compatible — Built-in signals for bulk scanning stocks with gaps
✅ Clean & Lightweight — No repainting, no lag, works on all markets (stocks, forex, crypto, indices)
🎯 Use Cases
Day/Swing Trading: Identify gap fill opportunities on intraday and daily charts
Earnings Plays: Track post-earnings gaps on daily/weekly timeframes
Breakout Confirmation: Gaps often signal strong momentum or trend continuation
Support/Resistance Zones: Unfilled gaps act as magnets for price action
Multi-Timeframe Analysis: Scan 4H gaps, daily gaps, or weekly gaps depending on your strategy
🛠️ Settings
Visibility Controls:
Toggle bull gaps, bear gaps, labels, and summary table on/off independently
Filter Settings:
Min Gap Size (%) — Ignore gaps smaller than this threshold (default 0.1%)
Max Gap Size (%) — Ignore abnormally large gaps like circuit breaker moves (default 5%)
Style Customization:
Gap box colors, border colors, and table position (Top Right, Top Left, Bottom Right, Bottom Left)
📈 How to Use with Pine Screener (TradingView Pro+)
Add indicator to any chart and set your desired timeframe (e.g., 4H for intraday gaps)
Open Pine Screener (bottom toolbar)
Select Gap Detector indicator
Choose Bull Gap Signal or Bear Gap Signal
Set condition: Above → 0
Click Scan to find all stocks with gaps on current candle
Screener Outputs:
Bull Gap Signal = 1 → Gap up formed on current candle
Bear Gap Signal = 1 → Gap down formed on current candle
Signal = 0 → No gap on current candle
📌 Notes
Gaps are detected based on previous candle close to current candle open — not wicks
Works on all markets and instruments where gaps occur (stocks, forex, crypto, futures, indices)
Signal plots appear in a separate pane below the chart for clean visualization
Gap count resets when you reload the chart or change timeframes
💡 Pro Tips
4H Timeframe: Great for intraday gap trading on volatile stocks
Daily Timeframe: Classic overnight gaps — ideal for gap fill strategies
Weekly/Monthly Timeframe: Macro trend analysis and major support/resistance zones
Combine with volume or momentum indicators for higher-probability setups
Created for traders who need fast, reliable gap detection without manual scanning.
Automatically detects and visualizes all price gaps across any timeframe — Daily, Weekly, Monthly, or Intraday.
📊 What It Does
This indicator identifies true price gaps where the current candle opens completely above (gap up) or below (gap down) the previous candle's range, with no price overlap between them.
Gap Up (Bullish): Current candle's low > Previous candle's high
Gap Down (Bearish): Current candle's high < Previous candle's low
✨ Key Features
✅ Auto-Detects Chart Timeframe — Works on any timeframe without manual selection (1min, 5min, 1H, 4H, Daily, Weekly, Monthly)
✅ Visual Gap Boxes — Green boxes for gap ups, red boxes for gap downs, drawn exactly across the gap zone
✅ Gap Size Labels — Shows gap percentage on each box for quick assessment
✅ Customizable Filters — Set minimum and maximum gap size % to filter noise
✅ Summary Statistics Table — Live count of bull gaps, bear gaps, and total gaps detected
✅ Pine Screener Compatible — Built-in signals for bulk scanning stocks with gaps
✅ Clean & Lightweight — No repainting, no lag, works on all markets (stocks, forex, crypto, indices)
🎯 Use Cases
Day/Swing Trading: Identify gap fill opportunities on intraday and daily charts
Earnings Plays: Track post-earnings gaps on daily/weekly timeframes
Breakout Confirmation: Gaps often signal strong momentum or trend continuation
Support/Resistance Zones: Unfilled gaps act as magnets for price action
Multi-Timeframe Analysis: Scan 4H gaps, daily gaps, or weekly gaps depending on your strategy
🛠️ Settings
Visibility Controls:
Toggle bull gaps, bear gaps, labels, and summary table on/off independently
Filter Settings:
Min Gap Size (%) — Ignore gaps smaller than this threshold (default 0.1%)
Max Gap Size (%) — Ignore abnormally large gaps like circuit breaker moves (default 5%)
Style Customization:
Gap box colors, border colors, and table position (Top Right, Top Left, Bottom Right, Bottom Left)
📈 How to Use with Pine Screener (TradingView Pro+)
Add indicator to any chart and set your desired timeframe (e.g., 4H for intraday gaps)
Open Pine Screener (bottom toolbar)
Select Gap Detector indicator
Choose Bull Gap Signal or Bear Gap Signal
Set condition: Above → 0
Click Scan to find all stocks with gaps on current candle
Screener Outputs:
Bull Gap Signal = 1 → Gap up formed on current candle
Bear Gap Signal = 1 → Gap down formed on current candle
Signal = 0 → No gap on current candle
📌 Notes
Gaps are detected based on previous candle close to current candle open — not wicks
Works on all markets and instruments where gaps occur (stocks, forex, crypto, futures, indices)
Signal plots appear in a separate pane below the chart for clean visualization
Gap count resets when you reload the chart or change timeframes
💡 Pro Tips
4H Timeframe: Great for intraday gap trading on volatile stocks
Daily Timeframe: Classic overnight gaps — ideal for gap fill strategies
Weekly/Monthly Timeframe: Macro trend analysis and major support/resistance zones
Combine with volume or momentum indicators for higher-probability setups
Created for traders who need fast, reliable gap detection without manual scanning.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.