# NR7 (narrow range 7) breakout on ES futures, 1-minute data - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-22 (approved by the owner the same day, draft 1 unchanged)**. No daily range, NR7 day, 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 what was looked at before
- **Chosen by the owner** on 2026-10-22 ("hai sa facem acum ... NR7"), from the ES options offered the same day (opening gap fill, done first; daily floor pivots; Crabel's NR7).
- **The idea:** Toby Crabel (*Day Trading with Short Term Price Patterns and Opening Range Breakout*, 1990) observed that a day with the **narrowest range of the last 7 days (NR7)** tends to be followed by a wider one: contraction before expansion. The popular trade, spread by Linda Raschke and others, buys a break above the NR7 day's high or sells a break below its low on the next day, with the stop at the other side. Crabel's own entries used an opening-range "stretch"; we test the popular high/low version and say so.
- **Looked at before (disclosed):** on this ES file the site has published RSI(2), Supertrend, Bollinger, Donchian, RSI divergence, MACD, golden crosses, Coppock, EMA 9/21, intraday momentum, the noise area breakout, VWAP strategies, Fibonacci scalping, the Initial Balance breakout and the opening gap fill (all buried), and tested opening-range breakouts with fair value gaps before the protocol. **No NR7 or narrow-range day has been computed on any market on this site.**

## Instrument and data
- **ES** (E-mini S&P 500 futures), `ES_1min.csv` (NinjaTrader, back-adjusted continuous contract), 1-minute bars on the New York clock, stamped at their close, 2020-01-01 to **2026-09-25**, with the exchange calendar of our other futures tests (`rb_lib.js`) for the regular session (09:30 to 16:00, or the early close).
- **Daily bars = the regular session:** high, low, open and close of the 1-minute bars from 09:31 to the session close. A day without its 09:31 bar or with fewer than 300 minutes (early-close days: fewer than 150) is not a usable day; it neither forms nor breaks an NR7 sequence (the seven days are the last seven usable days, and a gap of more than 7 calendar days between usable days restarts the count).
- Back-adjustment shifts all prices of a contract equally, so a day's range is unchanged; levels are on the adjusted series, as in all our ES tests.
- **Holes (rule 3):** `data_holes.json` (ES); every gate and verdict is recomputed without trades touching a known hole.

## Rules (one position at a time)
- **NR7 day k:** the range (high - low) of day k is **smaller than** the range of each of the 6 usable days before it (a tie is not NR7). **NR4:** smaller than each of the 3 before it.
- **Entry on day k+1 (the next usable day):** a **buy stop one tick (0.25) above day k's high** and a **sell stop one tick below its low**, both active from the 09:31 bar to the session close; the first one touched is the trade; the other order is cancelled. A bar opening beyond a level fills at its open. If the first minute that touches a level touches both, the trade is the level nearer that minute's open and it counts as stopped in the same minute (the worst case).
- **Stop:** the other entry level (one tick beyond the other side of day k), fixed. **R** = the entry-to-stop distance in points.
- **Three variants:**
  - **NR7-BO:** NR7 days; exit at the close of the last bar at or before day k+1's session close.
  - **NR7-2D:** NR7 days; the same entry and stop, held overnight; exit at the session close of day k+2 (the stop is checked on every minute in between, overnight included).
  - **NR4-BO:** NR4 days (Crabel also studied NR4); otherwise as NR7-BO.
- A signal that comes while a position is open (possible in NR7-2D) is not taken.

## Costs
- **$30.76 per round trip per contract** (commission $5.76 plus one tick, $12.50, of slippage on each fill), as in all our ES tests. Results in dollars per contract and in R.

## Periods, gates, control
- **Periods (by entry date), as in the other ES and NQ tests:** development 2020 to 2023; validation 2024-01 to 2025-03; holdout 2025-04 to 2026-09-25 (**already used**).
- **Sample size, stated before the run:** NR7 days are about one day in seven, so the validation period (about 313 trading days) should have roughly 45 and the holdout roughly 53, before untriggered days are removed. **The NR7 variants will probably fail the gate of at least 50 trades in each period by construction.** The rule is too rare for our periods; we report it rather than change the periods. NR4 (about one day in four) should have enough.
- **Six gates per variant** (net dollars per contract): validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (breakout rules have been tried many times on this ES file: Donchian, noise area, Initial Balance, opening ranges); 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 in all: Inconclusive.
- **Matched control (moved signal days):** the set of signal days moved, all together, by one random circular offset of whole usable days (at least 5% of them); on each new day the same rules are applied to **the previous day's** high and low (whatever its range): same entry, stop, exit and costs. 500 runs, seeds 1000 + run. Statistic: average net dollars per trade. It asks whether the narrow-range day beats a breakout of an ordinary day's range.
- **Also reported (descriptive):** the next day's range as a multiple of the average range of the previous 20 days, after NR7 days, NR4 days and all days (the contraction-expansion claim itself); the share of next days that break the high, the low, both or neither; long and short; by year; exits by reason.

## Engine and self-test (before the run)
New engine `nr7_lib.js`, independent re-implementation `nr7_ref.js`, `nr7_selftest.js` that must pass before any result is printed: hand-worked days for an NR7 and an NR4 day, a tie (not NR7), an unusable day inside the window, a break up, a break down, a gap open beyond a level, a minute touching both levels, the stop, the session-close exit, the overnight hold and its stop; the reference matched trade by trade on the real data for all three variants; the control at offset 0 reproducing the real trades.

## Before the article
Results go to the owner first. One article, published only with the owner's agreement. Working title for search: "NR7 Trading Strategy Backtest: Does the Narrow Range Breakout Work on ES Futures?"

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One market, one data source, the popular reading of a rule Crabel himself traded differently.
