OPEN-SOURCE SCRIPT
RTH Gap Detector with CE

### RTH Gap Detector with C.E.
This indicator detects the gap between the **9:30 AM ET RTH open** and the prior session’s **4:14 PM ET close**. It draws a box over the gap and marks its midpoint as **Consequent Encroachment (C.E.)**. The box extends until price fully fills the gap.
Gap grades are size-based, calculated as a percentage of the prior RTH close: **A** is at or above the Grade A threshold (**0.75% by default**), **B** is at or above the Grade B threshold (**0.25% by default**) but below A, and **C** is below B. These are customizable thresholds, not a separate ICT grading convention.
Settings let you filter small gaps, show or hide labels and the C.E. line, choose bullish/bearish or grade-based colors, and set the label size. By default, it keeps the **five most recent gaps**, including filled gaps. The default session uses New York time; on a 24-hour market such as BTC, it applies that time window to the chart’s prices.
This indicator detects the gap between the **9:30 AM ET RTH open** and the prior session’s **4:14 PM ET close**. It draws a box over the gap and marks its midpoint as **Consequent Encroachment (C.E.)**. The box extends until price fully fills the gap.
Gap grades are size-based, calculated as a percentage of the prior RTH close: **A** is at or above the Grade A threshold (**0.75% by default**), **B** is at or above the Grade B threshold (**0.25% by default**) but below A, and **C** is below B. These are customizable thresholds, not a separate ICT grading convention.
Settings let you filter small gaps, show or hide labels and the C.E. line, choose bullish/bearish or grade-based colors, and set the label size. By default, it keeps the **five most recent gaps**, including filled gaps. The default session uses New York time; on a 24-hour market such as BTC, it applies that time window to the chart’s prices.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。