PROTECTED SOURCE SCRIPT
Overnight Gap Detector - 4H Body to Body

This TradingView indicator automatically detects and tracks overnight price gaps based on 4-hour candle bodies, displaying them as colored rectangles on your chart.
Key Features:
Gap Detection:
Identifies true wick-to-wick gaps that occur at the start of each new trading day
Gap Up: Detected when previous candle's high is below current candle's low
Gap Down: Detected when previous candle's low is above current candle's high
Rectangles are drawn from candle body to body (not wicks), providing clean gap zones
Gap Tracking:
Gaps are marked as "GAP HOLE" when first detected
Automatically tracks when gaps get filled
Changes to "FILLED" label and color when price closes through the gap zone
Gaps extend horizontally until filled or chart end
Customizable Display:
Label Position: Choose between "Inside" (centered in box) or "Outside" the gap rectangle
Label Offset: Adjust how far from the right edge labels appear (0-50 bars)
Minimum Gap Size: Filter out small gaps by setting minimum percentage threshold (default 0.05%)
Max Stored Gaps: Control how many gaps are kept on chart (default 200)
Visual Options:
Optional midline showing the 50% fill level of each gap
Fully customizable colors for Gap Up, Gap Down, and Filled gaps
Separate transparency controls for box backgrounds and label backgrounds
Adjustable border and midline widths
Toggle labels and midlines on/off
Color Coding:
Green: Gap Up (default)
Red: Gap Down (default)
Yellow: Filled gaps (default)
Perfect for traders who use gap-fill strategies or want to track key price levels where gaps occurred
Key Features:
Gap Detection:
Identifies true wick-to-wick gaps that occur at the start of each new trading day
Gap Up: Detected when previous candle's high is below current candle's low
Gap Down: Detected when previous candle's low is above current candle's high
Rectangles are drawn from candle body to body (not wicks), providing clean gap zones
Gap Tracking:
Gaps are marked as "GAP HOLE" when first detected
Automatically tracks when gaps get filled
Changes to "FILLED" label and color when price closes through the gap zone
Gaps extend horizontally until filled or chart end
Customizable Display:
Label Position: Choose between "Inside" (centered in box) or "Outside" the gap rectangle
Label Offset: Adjust how far from the right edge labels appear (0-50 bars)
Minimum Gap Size: Filter out small gaps by setting minimum percentage threshold (default 0.05%)
Max Stored Gaps: Control how many gaps are kept on chart (default 200)
Visual Options:
Optional midline showing the 50% fill level of each gap
Fully customizable colors for Gap Up, Gap Down, and Filled gaps
Separate transparency controls for box backgrounds and label backgrounds
Adjustable border and midline widths
Toggle labels and midlines on/off
Color Coding:
Green: Gap Up (default)
Red: Gap Down (default)
Yellow: Filled gaps (default)
Perfect for traders who use gap-fill strategies or want to track key price levels where gaps occurred
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.