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
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.