# The Bitcoin CME gap fill, 1-minute data - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-21 (approved by the owner the same day, draft 1 unchanged)**. No gap, fill, signal or trade of this test has been computed. Once frozen, any change of a rule is documented and treated as a separate test; bugs may be fixed.

## Why this test, and where the claim comes from
- **Chosen by the owner** on 2026-10-21 ("da") after we proposed it for "intraday BTC": "btc cme gap", "cme gap filled / not filled" are among the most searched intraday Bitcoin topics.
- **The claim:** CME Bitcoin futures close on Friday afternoon and reopen on Sunday evening while Bitcoin trades all weekend; if the price moved, the CME chart shows a gap, and "CME gaps almost always fill": the price comes back to Friday's close. Usually traded by betting on the fill after the reopen.
- **Why the plain claim is not the test:** almost any level is revisited if you wait long enough, so "it filled eventually" is nearly true by construction. The tradable question is whether the gap fills **before a stop is hit**, after costs, and better than the same trade at other times.
- **Looked at before on this file:** the daily Turtle rules, a 15-minute trend pullback and the noise-area breakout on Bitcoin (all buried). No weekend or CME-hours measure has been computed.

## Data
- **Bitcoin:** the Binance BTCUSDT 1-minute file of the earlier Bitcoin tests (`BTCUSDT_1min.csv`, SHA-256 e52154201bd4b0552f9649036d53e8bfcf8897590e9265e665b0fef4616ed415, 2017-08-17 to 2026-09-30 23:59 UTC), spot prices, UTC clock.
- **CME hours (New York time, US clock changes applied):** the weekly close is **Friday 17:00** and the reopen **Sunday 18:00** (CME Globex, Bitcoin futures listed from 17-18 December 2017). Holidays that move the close or the reopen are **not** modelled (a stated simplification).
- **The gap is measured on spot:** Friday close = the close of the spot minute ending at 17:00 New York; Sunday open = the open of the spot minute starting at 18:00 New York. Gap % = open / close - 1. The real CME gap also contains changes in the futures premium; this is the spot approximation traders usually chart. Weekends with a missing minute at either time are skipped.
- **Weekends from 2017-12-17** (the first CME reopen) to the end of the file.

## Measures (descriptive, every weekend)
- Gap size and sign; the share of gaps filled (the spot price trades back to Friday's close) within 24 hours, 7 days, 30 days and by the end of the data; the median time to fill.

## Rules (the trade)
- **Signal:** at the Sunday 18:00 open, if |gap| >= **1.0%**, trade **toward the gap**: sell if the price opened above Friday's close, buy if below. Entry at that minute's open.
- **Target:** Friday's close (the gap filled). **Stop**, as a multiple of the gap size beyond the entry:
  - **CG-S1:** stop 1x the gap (target and stop equally far: 1R = the gap);
  - **CG-S2:** stop 2x the gap (1R = twice the gap; the target is 0.5R);
  - **CG-NS:** no stop.
- **Time exit:** any trade still open at the next **Friday 17:00 New York** (the next CME close) closes at that minute's open.
- Stop tested before target inside a minute; in the entry minute both fill at their level; later a level beyond a minute's open fills at the open. One trade per weekend, so no overlap.
- **Three variants.** For CG-NS, R = the gap size, for comparison.

## Costs
**0.05% of the price on every fill** (about 0.1% a round trip), the Binance USD-margined perpetual taker fee, as in our other Bitcoin tests, so that shorts are possible. Funding over the holding period is not in the base result; the average holding time is reported and funding was negligible in the earlier Bitcoin tests.

## Results, periods, gates, control
- **Units:** net R per trade, and % of the price.
- **Periods (by entry date), as in the other Bitcoin tests:** development to 2021-06-30 (here from 2017-12-17); validation 2021-07-01 to 2023-12-31; holdout 2024-01-01 to 2026-09-30 (**used three times before**).
- **Six gates per variant:** validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.0** (three variants of a strategy not tested before on the site); above the 95th percentile of 500 runs of the matched control; positive without the 10 best trades; holdout net positive (flagged used). Fewer than 30 trades: Inconclusive.
- **Matched control (moved entries):** every real entry moved, all together, by one random circular offset of whole days (at least 5% of them), to the same time of day on another day, same direction, the same target and stop distances in % of the entry price, and a time exit 5 days and 23 hours later (the real trades' maximum, Sunday 18:00 to Friday 17:00). 500 runs, seeds 1000 + run. Statistic: average net R per trade. It asks whether fading the weekend gap at the reopen beats the same trade at random times.

## Engine and self-test (before the run)
New engine `cg_lib.js`, independent re-implementation `cg_ref.js`, `cg_selftest.js` that must pass before any result is printed: UTC to New York across clock changes, the Friday and Sunday minutes, the gap and the 1% filter, the fill measures, direction, target, both stops, the Friday time exit, gaps through a level, costs; the reference matched trade by trade on the real data for all three variants; the control at offset 0 reproducing the real entries.

## Before the article
Results go to the owner first: the fill statistics, all three variants, every gate, by year. One article, published only with the owner's agreement. Working title for search: "Bitcoin CME Gap Fill: Do CME Gaps Always Fill? 8 Years Tested".

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. Spot prices, not CME futures; one exchange; one gap threshold.
