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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.