# Noise Area Breakout on Bitcoin (BTCUSDT), around the clock (24/7) - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-15 (approved by the owner the same day, draft 2)**, before any noise-area band, signal or trade was computed on Bitcoin. (Draft 1 used the three sessions of the earlier noise-area tests, Monday to Friday; the owner chose the 24/7 version instead, before anything was computed.) Once frozen, any change of a rule is documented and treated as a separate test; bugs may be fixed.

## The idea, and what was looked at before
- **Chosen by the owner** on 2026-10-15: the Noise Area Breakout on Bitcoin, around the clock, every day of the week.
- The rule is that of Zarattini, Aziz and Barbon, "Beat the Market: An Effective Intraday Momentum Strategy for the S&P500 ETF (SPY)" (2024), built for the US stock session. Here it is applied to Bitcoin's own day: **the UTC day, 00:00 to 24:00, seven days a week**, the day of the daily candle on Binance and most crypto exchanges. One BTC per trade; no position sizing or leverage from the paper.
- **What changes against the published setting, stated in the article:**
  1. There is no session close and no overnight gap: yesterday's close and today's open are the same moment, so the rule's "previous close" adjustment has almost no effect and the bands are centred on the 00:00 UTC open.
  2. The end of the day (24:00 UTC) is a convention of the crypto market, not a closing auction.
  3. Weekends are included, in the bands as in the trades.
- **What we already know, stated in the article:** the same rule was tested on ES (none of 6 passed), NQ (both New York versions passed every gate and are in a forward test) and gold (none of 6 passed), all on exchange sessions. Bitcoin is the fourth market of this family, chosen after those results were known.
- **Earlier use of this Bitcoin file:** the daily Turtle test (2026-10-12 to 14) and the 15-minute intraday trend pullback (2026-10-14). No noise-area band, signal or trade was computed on Bitcoin. **The holdout (2024 to September 2026) was opened twice before**, by those two tests, and is reported as used.

## The day
- **Open:** 00:00 UTC (the open of the first minute of the day). **Close:** 24:00 UTC (the close of the 23:59 minute). Every calendar day, Monday to Sunday; UTC has no daylight saving.
- **Checkpoints:** every 30 minutes, 00:30 to 23:30 UTC (47 a day).
- A day is used only if its first and last minutes exist; otherwise it has no trade and is counted.

## Rules (as in the earlier noise-area tests)
- **Previous close** = the close of the previous day (24:00 UTC). If the previous day is missing or more than 4 calendar days older, no trade that day.
- **Move from the open:** for each checkpoint m, |close at m / open - 1|. **sigma(m)** = the average of that move at the same m over the **previous 14 days** that have a minute at m (at least 10 required, otherwise no signal at that m).
- **Noise area:** upper band = max(open, previous close) x (1 + sigma(m)); lower band = min(open, previous close) x (1 - sigma(m)).
- **Decisions** use the close of the checkpoint minute; orders fill at the open of the next minute (if missing, the next minute of the day that exists; if none, at the day's close).
- **Entry:** flat and close above the upper band: buy; below the lower band: sell short (no shorts in the long-only variant).
- **Exit (trailing stop, checked at the checkpoints):** a long is closed when the close falls below max(upper band, VWAP); a short when it rises above min(lower band, VWAP). At a checkpoint with an exit, only the opposite position can open (a flip, long and short variant). Every position is closed at 24:00 UTC.
- **VWAP:** from 00:00 UTC, typical price (high + low + close) / 3 weighted by the **real traded volume** of each minute (on gold we only had tick volume). With no volume yet, the stop uses the band only.
- **Two variants:** long and short (**NA-BTC-24H-LS**) and long only (**NA-BTC-24H-L**).

## Data, costs, units
- **Data:** the Binance BTCUSDT 1-minute file of the earlier Bitcoin tests (`BTCUSDT_1min.csv`, SHA-256 `e52154201bd4b0552f9649036d53e8bfcf8897590e9265e665b0fef4616ed415`, 2017-08-17 04:00 to 2026-09-30 23:59 UTC), spot prices and spot volume, UTC clock, minutes stamped at their close.
- **Costs: 0.05% of the price on every fill** (entry and exit, about 0.1% a round trip; a flip pays two round trips): the taker fee of Binance USD-margined perpetual futures, where shorts are possible, as in our other Bitcoin tests. No slippage beyond gaps: optimistic for a breakout entry, and stated (weekend and night liquidity is thinner).
- **Funding (scenario, not the verdict):** longs pay and shorts receive 0.01% of the price at each funding time (08:00 and 16:00 UTC; 00:00 is never crossed, as every position closes at 24:00) a position is held. Not a historical series: real rates varied, often higher in strong markets.
- **Unit:** the **net result in percent of the entry price** per trade (the same as dollars per $100 traded); gates use it. Dollars per BTC are shown beside it.
- **Holes (rule 3):** days touching a gap of 10 minutes or more in `btc_gaps.json` are reported, and every gate and verdict is recomputed without them; a changed verdict becomes Inconclusive.

## Periods, gates, control
- **Periods (by trade date), as in the other Bitcoin tests:** development 2017-09-15 to 2021-06-30; validation 2021-07-01 to 2023-12-31; holdout 2024-01-01 to 2026-09-30 (**used twice before**). Days before 2017-09-15 only feed the first bands.
- **Six gates per variant:** validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (the noise-area rule now has more than 4 variants on the site: 18 earlier plus these 2); above the 95th percentile of the control; positive without the 10 best trades; holdout net positive (flagged used). Fewer than 30 trades: Inconclusive.
- **Control (as on the other markets):** each day's first entry (checkpoint and direction) is moved, all days together, by one random circular offset of at least 5% of the days; on the new day the position opens at the same checkpoint in the same direction and is then managed by the same exit rule and costs. 500 runs, seeds 1000 + run. It asks whether the band breakout picks better days and times than the same entries placed on other days.

## Engine and self-test (before the run)
- `na_lib.js` stays **untouched**: its SHA-256 is pinned by the NQ forward test. A new engine `na_btc_lib.js` takes the session times as an input (the UTC day here) and costs in percent of the price; the band, entry and exit code is the same rule.
- Self-test, which must pass before any Bitcoin result is printed:
  1. **Equivalence:** given the ES and NQ session times and costs, `na_btc_lib.js` reproduces every trade of `na_lib.js` on ES and NQ, all 12 variants (proves the new engine applies the same rule).
  2. Hand-worked Bitcoin cases: the UTC day and its 47 checkpoints, a weekend day, the previous close, sigma from 14 days, both bands, a long, a short, the VWAP stop and the band stop, a flip, the 24:00 exit, a missing minute at a checkpoint, a day without its first minute, the cost of a fill and of a flip in percent, the funding times crossed.
  3. An **independent re-implementation** (`na_btc_ref.js`) matched trade by trade for both variants.
  4. The control at offset 0 reproduces the real first entries.

## Before the article
Results go to the owner first: both variants and every gate, long and short separately, by year, weekdays against weekends, by hour of entry, how trades ended (stop, flip, end of day), the cost against the gross, the funding scenario, the hole check. One article, published only with the owner's agreement.

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One rule, one exchange's spot data, a day boundary set by convention.
