Gap AnalysisDescription:
This indicator automates the tracking of session gaps, providing real-time data on gap fills, historical context, and exhaustion risk. It is built specifically for day traders and swing traders who use gap-fill strategies during Regular Trading Hours (RTH).
Core Functionality:
The script captures the closing price (settle) of the previous RTH session and measures it against the open of the current RTH session. If a gap exceeds your minimum point threshold, it maps the gap zone on your chart and tracks price action against the settle line until the gap is filled.
Key Features:
Dynamic Fill Tracking: Monitors unfilled gaps bar-by-bar. It calculates the exact percentage of the gap filled and displays how many bars it took to reach completion.
Exhaustion Risk Detection: Tracks consecutive gaps in the same direction. If the market gaps in the same direction three or more times consecutively, the script flags an "Elevated Exhaustion" risk on the display panel.
Clean Chart Management: Automatically shades the gap zone and draws the target settle line. You can toggle a setting to instantly hide gaps once they are 100% filled, preventing chart clutter.
Heads-Up Display Table: An on-chart dashboard provides immediate access to the current session's gap direction, fill status, specific target price, and elapsed time.
Historical Gap Review: Displays up to 20 historical session gaps, allowing you to backtest how often and how quickly an asset fills its gaps.
Integrated Alerts: Supports automated alerts for two conditions: when a new qualifying gap is formed at the session open, and the moment a gap is entirely filled.
Configuration & Setup:
RTH Session: Define your specific trading hours (default is 0830-1500 America/Chicago). The indicator requires this to accurately lock in the previous day's settle.
Minimum Gap Size: Filter out market noise by setting a minimum point threshold. Gaps smaller than this value will be ignored.
Visual Customization: Full control over bull/bear zone colors, line styles, text sizes, and table positioning.
Usage Notes:
This script relies on timeframe data to establish session boundaries. It is optimal for intraday timeframes (e.g., 1m, 5m, 15m, 1H).
Indicador Pine Script®




















