OPEN-SOURCE SCRIPT
Bitcoin CME Gaps [PhantomCipher]

Bitcoin CME Gaps
Bitcoin trades around the clock, but CME Bitcoin futures stop trading over the weekend. When CME reopens, its chart often opens away from Friday's close, leaving a "CME gap". This indicator draws the CME closing level on your Bitcoin chart for the whole weekend, so you can see how far price has moved from it while CME is closed.
SNAPSHOT: a 15m Bitcoin chart over one weekend, with the blue CME line and the shading between it and price
Recommended timeframe: 15 minutes
The weekend window is worked out from each candle's opening time, so the line needs candles small enough to start when CME closes and end when it reopens. The 15-minute chart is what this indicator is designed and tested for.
How it works
The weekend window check, with the day and hour in the chart's timezone (UTC for crypto):
Pine Script®
SNAPSHOT: close-up of Sunday's reopen, with the line ending where CME resumes trading
Settings
Limitations
Example chart:
BTCUSDT.P
This indicator marks where CME closed. It's not a trading signal on its own, and a gap is not guaranteed to fill, so combine it with your own analysis and risk management.
Bitcoin trades around the clock, but CME Bitcoin futures stop trading over the weekend. When CME reopens, its chart often opens away from Friday's close, leaving a "CME gap". This indicator draws the CME closing level on your Bitcoin chart for the whole weekend, so you can see how far price has moved from it while CME is closed.
SNAPSHOT: a 15m Bitcoin chart over one weekend, with the blue CME line and the shading between it and price
Recommended timeframe: 15 minutes
The weekend window is worked out from each candle's opening time, so the line needs candles small enough to start when CME closes and end when it reopens. The 15-minute chart is what this indicator is designed and tested for.
How it works
- Weekend window: from Friday 21:00 UTC to Sunday 22:00 UTC. That matches CME Bitcoin futures hours while US daylight saving time is in effect. In winter, CME closes and reopens one hour later.
- CME line: a blue line at the price where the weekend began. It's drawn only during the weekend and stops when CME reopens.
- Shading: the area between the line and price is green while price is above the line and pink while it's below, so you can see the direction of the gap as it forms.
The weekend window check, with the day and hour in the chart's timezone (UTC for crypto):
SNAPSHOT: close-up of Sunday's reopen, with the line ending where CME resumes trading
Settings
- [On]Chart Price | [Off] CME Price: on by default, and the line uses your chart's own price at the start of the weekend. Turn it off to use CME:BTC1!'s last price instead, which can differ from spot or perpetual prices.
- Only Show Weekend Gaps: on by default, and the line appears only in the weekend window above. Turn it off to draw a line whenever CME:BTC1! has no candle, which also covers CME's daily one-hour break and exchange holidays, at the cost of a busier chart.
- Show +/-1% From Close: off by default. Adds yellow lines 1% above and 1% below the CME line.
Limitations
- With "Only Show Weekend Gaps" on, lines appear only on crypto charts, index charts and charts in the UTC timezone.
- The weekend window uses fixed UTC hours, so in winter it starts and ends one hour before CME's actual close and reopen.
- The line marks the level while CME is closed. It does not keep drawing gaps that are still unfilled after CME reopens.
Example chart:
This indicator marks where CME closed. It's not a trading signal on its own, and a gap is not guaranteed to fill, so combine it with your own analysis and risk management.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน