OPEN-SOURCE SCRIPT
RTH Time based Gap Fill Statistic

Description
Overview
The RTH Gap Time based Gap Fill Statistic is a quantitative analysis tool designed for intraday mean-reversion and trend traders. It tracks the behavior of "Gaps" (the price difference between the previous day's 4:00 PM ET close and the 9:30 AM ET RTH open) over a rolling 126-trading-day window (approximately 6 months of data).Instead of just telling you if a gap fills, this indicator tells you when it typically fills, allowing you to align your trades with the highest probability time windows.
Key Features
Rolling 126-Day Lookback: Maintains a dynamic sample size to capture current market regime shifts.
Granular Time Buckets: Categorizes fills into specific windows
- Opening Volatility (9:30–9:59)
- First Hour Windows (10:00–10:15, 10:16–10:30, 10:31–11:00)
- Late Day Fills (After 11:00)
Gap Up vs. Gap Down Separation: Statistics are split to account for the inherent "long bias" or "short covering" dynamics often found in gap behavior.
Probability Heatmap: The table uses color-coding to highlight high-probability windows (Teal) and low-probability/unfilled risks (Red).
How to Interpret the Data
The 9:30–9:59 Cluster: Historically, the vast majority of gap fills occur in the first 30 minutes. If the gap is not filled in this window, the probability of a fill occurring in any subsequent 15-minute block drops significantly.
The "Not Filled" Row: This is your risk management metric. If the "Not Filled" percentage is high (e.g., >35%), it indicates a high frequency of "Runaway Gaps" or "Breakaway Gaps," warning you not to "fight the trend" expecting a mean reversion.
Gap Sentiment: Use the n count to see if the market has had a recent bias toward gapping up or gapping down, which can signal broader regime sentiment.
Technical Details
Time zone: Designed for RTH (Regular Trading Hours) sessions (9:30 AM – 4:00 PM ET).
Precision: Uses a 1-minute calculation base to ensure high-fidelity detection of the exact moment a gap is touched.
Visuals: A clean, bottom-left anchored table that updates in real-time as the session progresses.
DisclaimerThis indicator is for educational and informational purposes only. Historical probabilities do not guarantee future results. Always use proper risk management and stop-losses when trading gap fades.
Overview
The RTH Gap Time based Gap Fill Statistic is a quantitative analysis tool designed for intraday mean-reversion and trend traders. It tracks the behavior of "Gaps" (the price difference between the previous day's 4:00 PM ET close and the 9:30 AM ET RTH open) over a rolling 126-trading-day window (approximately 6 months of data).Instead of just telling you if a gap fills, this indicator tells you when it typically fills, allowing you to align your trades with the highest probability time windows.
Key Features
Rolling 126-Day Lookback: Maintains a dynamic sample size to capture current market regime shifts.
Granular Time Buckets: Categorizes fills into specific windows
- Opening Volatility (9:30–9:59)
- First Hour Windows (10:00–10:15, 10:16–10:30, 10:31–11:00)
- Late Day Fills (After 11:00)
Gap Up vs. Gap Down Separation: Statistics are split to account for the inherent "long bias" or "short covering" dynamics often found in gap behavior.
Probability Heatmap: The table uses color-coding to highlight high-probability windows (Teal) and low-probability/unfilled risks (Red).
How to Interpret the Data
The 9:30–9:59 Cluster: Historically, the vast majority of gap fills occur in the first 30 minutes. If the gap is not filled in this window, the probability of a fill occurring in any subsequent 15-minute block drops significantly.
The "Not Filled" Row: This is your risk management metric. If the "Not Filled" percentage is high (e.g., >35%), it indicates a high frequency of "Runaway Gaps" or "Breakaway Gaps," warning you not to "fight the trend" expecting a mean reversion.
Gap Sentiment: Use the n count to see if the market has had a recent bias toward gapping up or gapping down, which can signal broader regime sentiment.
Technical Details
Time zone: Designed for RTH (Regular Trading Hours) sessions (9:30 AM – 4:00 PM ET).
Precision: Uses a 1-minute calculation base to ensure high-fidelity detection of the exact moment a gap is touched.
Visuals: A clean, bottom-left anchored table that updates in real-time as the session progresses.
DisclaimerThis indicator is for educational and informational purposes only. Historical probabilities do not guarantee future results. Always use proper risk management and stop-losses when trading gap fades.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.