OPEN-SOURCE SCRIPT
업데이트됨

Bitcoin CME GAP [SAKANE]

282
This indicator detects and visualizes the weekend gap in CME Bitcoin futures (BTC1!), defined as the difference between the Friday settlement price and the Monday opening price. It stores the final CME close, waits for trading to resume, and then measures the gap. If the gap exceeds the user-defined threshold, it is displayed as a box on the chart. The box remains active until price returns to the gap’s closing level or a specified number of bars has elapsed. During the CME weekend closure, a horizontal reference line marks where CME last settled, providing a clear anchor for price positioning.

A key feature is that the gap is displayed correctly even on spot or perpetual BTC charts. Because futures prices often trade at a premium or discount relative to spot markets, plotting CME levels directly would misplace the gap. This script calculates the price difference between CME and the chart instrument and shifts the gap vertically into the chart’s price space while preserving its true size. As a result, traders can see the actual gap location where market participants are likely to react, without distortion from futures basis differences.

Gap-fill detection is performed using CME futures prices themselves. The script evaluates whether the CME high or low has reached the prior CME close level that defines the gap. This ensures that once the gap is filled in the futures market, it is considered filled everywhere. Because of this CME-based validation combined with spot-space visualization, users can determine whether a gap has closed without switching to the BTC1! chart.

CME gaps are widely observed by market participants because price frequently revisits and fills these discontinuities. By highlighting both the location and the fill status of the gap, this indicator helps track the gap-closure tendency and provides insight into short-term liquidity imbalances, derivatives-driven dislocations, and the market’s process of price repair.
릴리즈 노트
The adjustPremium option has been added to control how the gap is positioned on the chart.

When adjustPremium is OFF, the gap is drawn using raw CME futures prices. The box is plotted directly between the BTC1! Friday close (g_prev) and Monday open (g_open). Because no adjustment is applied, the gap reflects CME’s absolute price levels, including any futures premium or discount relative to spot markets.

When adjustPremium is ON, the gap is aligned to the chart’s price space. The Friday side is anchored to the chart’s closing price at the same moment as the CME Friday close (last_chart_close), while the Monday side uses the chart’s opening price on the CME reopen bar (open). In practice, this aligns the gap with the price levels of the instrument being viewed (e.g., Binance spot or perpetual), making it easier to see where the gap-equivalent discontinuity exists in the spot market.

Importantly, gap-fill detection continues to be evaluated strictly using CME futures prices (cme_high_off / cme_low_off). Even when the gap is visually aligned to the chart’s price space, fill status remains CME-native and consistent. This allows users to determine whether the CME gap has been filled without switching to the BTC1! chart.
릴리즈 노트
Fixed an issue where the indicator would fail to display on certain symbols and timeframes.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.