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. קרא עוד ב־תנאי השימוש.