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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.