NR7: breaking out of the narrowest day in seven
Micro E-mini S&P 500 (MES) · 5-minute bars · 2016 to 2026 · Breakout · Narrow-range days are from Toby Crabel's work
Marginal: profit factor 1.71 out of sample, not clearly above break-even, t = 1.7.
- Profit factor, out of sample
- 1.71
- Average trade, out of sample
- +0.15R
- Win rate, out of sample
- 59%
- Trades, 10 years
- 156
- Max drawdown
- $2,117
- Pass odds, median plan
- 0.0%
Hypothetical results. These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
Abstract
We backtested the NR7 breakout rules on Micro E-mini S&P 500 (MES) 5-minute bars from 2016-01-11 to 2026-10-30: 156 trades, with commission and a tick of slippage on every market and stop fill. In sample (to 2023-08-03) it made +0.03R per trade with a profit factor of 1.16; out of sample (from 2023-08-04) +0.15R per trade and 1.71 over 56 trades. 16 of the 16 parameter settings we tried were profitable out of sample. Sized at $250 of risk a trade, simulated 50K evaluations passed 0% to 0% of the time across 36 tracked plans.
1Hypothesis
When yesterday was the quietest day of the last seven, bracket its range today and trade whichever side breaks, with the stop at the other side.
If volatility contracts before it expands, the day after the narrowest range in seven should break that range and keep going more often than it reverses.
2Data
- Instrument
- Micro E-mini S&P 500 (MES), traded on the ES price series (ES.c.0: front month, rolled on the calendar). CME Globex via Databento.
- Period
- 2016-01-11 to 2026-10-30: 2,746 sessions, 1,056,820 one-minute bars, built into 210,816 5-minute bars of the regular session (09:30 to 16:00 ET).
- Costs
- $0.75 commission a contract each way and 1 tick ($1.25) of slippage on every market and stop fill. Limit orders fill when price touches them; market orders fill at the next bar's open and stops at their price, each with one tick of slippage; when a bar touches both the stop and the target, the stop counts.
- Position size
- About $250 of risk a trade: micro contracts, rounded down, at least one. R is a trade's net P&L divided by its risk at entry.
- Out of sample
- The last 30% of weekdays: 2023-08-04 on (846 days), after 1,974 in-sample days. The rules were fixed before either side was run.
3Method
Our reading of the publicly described rules; the creator may trade it differently. The rules, exactly as the code runs them:
- Each day's range is its regular-session (09:30-16:00 ET) high minus low. An NR7 day has the smallest range of the last lookback (7) days, itself included.
- The day after an NR7 day, if the first 5-minute bar opens and closes inside the NR7 day's range, a buy stop goes in buffer_ticks (1) tick above its high and a sell stop 1 tick below its low. When one fills, the other is cancelled. Orders work from 09:35 to 15:30 ET.
- Stop: the other side of the NR7 day's range.
- Target: target_r (1) times the risk.
- Exit: the stop, the target, or flat at 15:55 ET. One trade a day.
- Size: about risk_usd dollars of risk a trade (micro contracts, rounded down, at least 1 and at most max_contracts).
"""NR7 breakout on Micro E-mini S&P 500 (MES) 5-minute bars, regular session, New York time. After the narrowest regular-session range of the last seven days, trade the break of that day's range. Rules: 1. Each day's range is its regular-session (09:30-16:00 ET) high minus low. An NR7 day has the smallest range of the last `lookback` (7) days, itself included. 2. The day after an NR7 day, if the first 5-minute bar opens and closes inside the NR7 day's range, a buy stop goes in `buffer_ticks` (1) tick above its high and a sell stop 1 tick below its low. When one fills, the other is cancelled. Orders work from 09:35 to 15:30 ET. 3. Stop: the other side of the NR7 day's range. 4. Target: `target_r` (1) times the risk. 5. Exit: the stop, the target, or flat at 15:55 ET. One trade a day. 6. Size: about `risk_usd` dollars of risk a trade (micro contracts, rounded down, at least 1 and at most `max_contracts`)."""import qy class Bot(qy.Strategy): """Break of the range of the narrowest day of the last seven.""" symbol = "MES" timeframe = "5m" session = "rth" params = {"lookback": 7, "target_r": 1.0, "buffer_ticks": 1, "risk_usd": 250, "max_contracts": 50} max_position = 50 entry_window = ("09:35", "15:30") flatten_time = "15:55" overnight = False def setup(self): self.days = [] # (high, low) of completed sessions self.day = None self.h = self.l = None def _size(self, risk_points): per_contract = risk_points * self.point_value n = int(self.p.risk_usd // per_contract) if per_contract > 0 else 1 return max(1, min(self.p.max_contracts, n)) def on_fill(self, fill): if fill.kind == "entry": self.cancel_all() def on_bar(self, bar): if bar.date != self.day: if self.h is not None: self.days = (self.days + [(self.h, self.l)])[-60:] self.day, self.h, self.l = bar.date, bar.high, bar.low self._first_bar(bar) return self.h, self.l = max(self.h, bar.high), min(self.l, bar.low) def _first_bar(self, bar): n = self.p.lookback if len(self.days) < n: return ranges = [h - l for h, l in self.days[-n:]] yh, yl = self.days[-1] if ranges[-1] > min(ranges) or not (yl < bar.open < yh and yl < bar.close < yh): return buf = self.p.buffer_ticks * self.tick_size risk = yh - yl + 2 * buf qty = self._size(risk) f = (yh - yl) / bar.close * 100 self.buy(qty, stop=yh + buf, stop_price=yl - buf, target_r=self.p.target_r, tag=f"NR7 long | f={f:.4f}") self.sell(qty, stop=yl - buf, stop_price=yh + buf, target_r=self.p.target_r, tag=f"NR7 short | f={f:.4f}")4Results
| Statistic | In sample | Out of sample | All |
|---|---|---|---|
| Trades | 100 | 56 | 156 |
| Net P&L | +$992 | +$1,796 | +$2,788 |
| Profit factor | 1.16 | 1.71 | 1.32 |
| Average trade | +0.03R | +0.15R | +0.07R |
| 95% interval of the average | −0.11 to 0.17 | −0.03 to 0.33 | −0.04 to 0.18 |
| t-statistic of trade R | 0.38 | 1.66 | 1.26 |
| Win rate | 53% | 59% | 55% |
| Average win / average loss | 1.03 | 1.19 | 1.07 |
| Max drawdown | $2,117 | $875 | $2,117 |
| Sharpe ratio (daily, annualized) | 1.00 | 3.55 | 1.85 |
| Longest losing streak | 7 | 4 | 7 |
| Long / short profit factor | 1.50 / 0.84 | 1.58 / 1.85 | 1.52 / 1.12 |
| Average holding time | 326 min | 252 min | 299 min |
| Commission paid | $431 | $120 | $551 |
Drag across the chart to zoom into a period, double-click to reset.
Averages: +0.03R in sample, +0.15R out of sample.
Drag a box to zoom, double-click to reset.
5Robustness
We reran the strategy on a grid of 16 settings of its two main parameters, each on the full history with the same split. 5 were profitable in sample and 16 out of sample.
Lookback (days) across, target (R) up. Solid outline: the defaults we tested; dashed: the in-sample best.
Hover a cell for both sides of the split.
Lookback (days) 4.00 to 15.0 across · Target (R) 0.50 to 2.00 in depth · Profit factor, out of sample 1.34 to 3.78 as height and shade. Drag or use the arrow keys to turn it.
Drag to rotate; ctrl or ⌘ and scroll to zoom.
What would change it
The defaults were already the in-sample best of the grid, so there is no tweak to test: profit factor 1.16 in sample and 1.71 out of sample.
6Prop-firm implications
The backtest's sessions run through the rules of 36 tracked 50K evaluations: 2,000 runs of up to 60 sessions each, with the drawdown and daily limits checked against each trade's intraday low. Intervals are Wilson 95% intervals of the simulation. A simulation of the past, not the chance that anyone passes.
| Plan | Pass odds, 95% interval | Pass | Fail | Out of time | Median sessions |
|---|---|---|---|---|---|
| Alpha Futures Advanced 50K Evaluation | 0.0% | 0% | 100% | n/a | |
| Alpha Futures Standard 50K Evaluation | 0.0% | 0% | 100% | n/a | |
| Alpha Futures Zero 50K Evaluation | 0.0% | 0% | 100% | n/a | |
| Apex Trader Funding 50K EOD Evaluation | 0.0% | 0% | 100% | n/a | |
| Apex Trader Funding 50K Intraday Trailing Drawdown Evaluation | 0.0% | 0% | 100% | n/a | |
| AquaFutures Beginner 50K Evaluation | 0.0% | 0% | 100% | n/a | |
| Bulenox 50K Qualification Account (Legacy, Option 1, trailing drawdown) | 0.0% | 0% | 100% | n/a | |
| Bulenox 50K Qualification Account (Legacy, Option 2, EOD drawdown) | 0.0% | 0% | 100% | n/a | |
| Earn2Trade Gauntlet Mini $50K | 0.0% | 0% | 100% | n/a | |
| Earn2Trade Trader Career Path TCP50 | 0.0% | 0% | 100% | n/a |
7Limitations
- Ranges are the regular session's only; overnight trading isn't counted.
- Stop entries fill with a tick of slippage; fast breaks can slip more.
- One market (MES).
- A backtest on the past, with fills simulated from one-minute bars; live fills, queues and outages differ.
8Conclusion
Marginal: profit factor 1.71 out of sample, not clearly above break-even, t = 1.7. The defaults were already the in-sample best of the grid, so there is no tweak to test: profit factor 1.16 in sample and 1.71 out of sample. The result is too close to break-even to tell apart from noise after costs.
9References
- Crabel, T. (1990). Day Trading with Short Term Price Patterns and Opening Range Breakout. Traders Press.