# Opening range breakout (5 minutes) on NQ futures - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-17 (approved by the owner the same day, draft 1 unchanged)**, before any opening range, signal or trade of this test was computed on the NQ data. 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-17 ("hai cu orb"), from three proposals made the same day for a much-searched futures strategy: the 5-minute opening range breakout, on NQ (Nasdaq-100 E-mini futures).
- **The published rule:** Zarattini and Aziz, "Can Day Trading Really Be Profitable?" (SSRN 4416622, 2023), on QQQ 1-minute data from 2016 to 2023: take the direction of the first 5-minute candle of the US session (no trade if it opened and closed at the same price), enter at the open of the second 5-minute candle, stop at the other side of the first candle, target ten times the risk, otherwise exit at the session close. They report about 24% winners and +0.13 R a trade, and large returns with leverage (1,484% on TQQQ), net of commissions but without spread or slippage, and with no out-of-sample period. Their paper also shows a version with a stop set from the 14-day ATR, chosen after looking at results; **we test the base rule only.** An independent third-party replication (a blog post, CFD cash data 2015-2026) reproduced the gross result on the Nasdaq-100 (+0.131 R) and found it near zero after costs.
- **The classic opening range breakout** (enter when the price breaks above the high or below the low of the opening range) is what most traders mean by "ORB"; it is tested here as a second rule on the same 5-minute range, with the paper's stop, target and exit.
- **Earlier work on this file:** the published NQ tests (EMA 9/21, the EMA 5/8/13 ribbon, the 9 EMA, intraday momentum and the noise area breakout, the last one now in a forward test). **Not published, without a protocol:** in September 2026 the owner's ORB with fair value gaps on ES, and our opening range breakouts of 5, 15 and 30 minutes on ES (2020 to 2025), showed no edge. **No opening-range number has been computed on NQ.** The strategy was proposed for its popularity, not for any result.

## Instrument and data
- **NQ** (E-mini Nasdaq-100 futures), `NQ_1min.csv` (NinjaTrader, back-adjusted continuous contract, SHA-256 7980d835...), 1-minute bars on the New York clock, stamped at their close, from 2020-01-01 to **2026-09-25 17:00 New York** (the common end of the futures studies). Back-adjustment shifts prices by constants at the rolls, which changes no price difference inside a day. One contract: $20 a point, tick 0.25 point ($5).
- **US session:** opens at 09:30 New York; the scheduled close is 16:00, or the earlier close of the exchange calendar used in our other NQ tests (`rb_lib.js`); days on which the session is not held have no trade.
- **Missing data:** a day has no trade if any of the five 1-minute bars of the opening range, or the bar starting 09:35, is missing; prices are never filled. Days touching a known hole of the file (`data_holes.json`) are reported (rule 3).

## Rules
- **Opening range:** the five 1-minute bars ending 09:31 to 09:35. Range open = the open of the first; range close = the close of the last; range high and low = the highest high and lowest low of the five.
- **ZA (the paper's rule):** if the range close is above the range open, buy; below, sell; equal, no trade. **Entry at the open of the 1-minute bar starting 09:35.** Stop: the range low for a buy, the range high for a sell. No trade if the entry price is already at or beyond the stop.
- **BO (the classic breakout):** from 09:35, a buy stop one tick above the range high and a sell stop one tick below the range low; the first one touched is the trade (one trade a day); the fill is the trigger price, or the bar's open if the bar opens beyond it. If both are touched inside the same 1-minute bar, the side nearer that bar's open is entered and the other side counts as its stop in the same bar (a full loss), as in our gold opening-range test. Entries until 13:30 New York (four hours after the open; earlier on early-close days: no entry later than one hour before the close). Stop: one tick beyond the opposite side of the range.
- **R** = the distance from the entry to the stop, in points; **target** = the entry plus (minus, for a sell) **10 R**; otherwise **exit at the close of the bar ending at the scheduled close**.
- Inside each 1-minute bar from the entry bar on: if the stop and the target are both touched, the stop is taken; a level the bar opens beyond fills at the open.
- One contract, at most one trade a day.
- **Four variants:** **ORB-ZA-LS, ORB-ZA-L, ORB-BO-LS, ORB-BO-L** (long and short / long only). The long-only variants take only the buy trades of the long-and-short rule: a day with a sell signal (ZA), or whose first break is downward (BO), has no trade.

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

## Periods, gates, control
- **Periods (by trade date):** development 2020 to 2023; validation 2024-01 to 2025-03; holdout 2025-04 to 2026-09-25 (**already used** by the earlier ES and NQ tests).
- **Six gates per variant** (results in dollars per contract): validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.0** (four variants of a strategy not tested before on the site); above the 95th percentile of the control; positive without the 10 best trades; holdout net positive (flagged used). Fewer than 30 trades: Inconclusive.
- **Control (shifted direction):** each day's direction (buy, sell or none) is moved, all together, by one random circular offset of at least 5% of the trading days and applied to the real days with the same stop, target, exit and costs (ZA: entry at 09:35 in the moved direction, the day's own range for the stop; BO: only the moved side's stop order is placed). 500 runs, seeds 1000 + run. Statistic: the average net dollars per trade. It asks whether the first five minutes say anything about the rest of the day beyond how often and which way the rule trades.
- **Also reported:** the share of trades reaching the 10 R target, stopped out and closed at the session close, the win rate with its Wilson interval, the average R before and after costs (the paper: about +0.13 R before costs), long and short separately, results by year, and the cost as a share of R.

## Engine and self-test (before the run)
A new engine (`orbq_lib.js`) using the existing futures loader and exchange calendar, and a self-test that must pass before any result is printed:
1. Hand-worked days: up, down and equal first candles; the entry at 09:35; a stop and a target in the same minute (stop taken); a gap through a level; an early-close day; a missing bar; for BO a first break up, a first break down, both sides in one minute, no break before 13:30.
2. The session times against the exchange calendar on the real data.
3. An **independent re-implementation** matched trade by trade for all four variants on the real data.
4. The control at offset 0 reproduces the real trades.

## Before the article
Results go to the owner first: all four variants and every gate, longs and shorts, by year, the exit reasons, before and after costs, and the comparison with the paper's figures. 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 market, one data source (back-adjusted NinjaTrader minutes), 2020 to 2026, the base rule only.
