NR7 Opening Range Breakout EA: Automating Toby Crabel's Compression Methodology
If you've spent any time studying intraday price action, you've probably run into the idea that volatility moves in cycles, periods of contraction followed by expansion. Toby Crabel built an entire trading philosophy around this concept in Day Trading with Short Term Price Patterns and Opening Range Breakout, and one of his most enduring tools is the NR7 pattern: a bar whose range is narrower than each of the previous six bars. That tight bar marks a compression zone, and compression zones tend to resolve with a directional move.
The NR7 Opening Range Breakout EA takes that concept and turns it into a fully mechanical, rules based intraday system for MetaTrader 5.
About NR7 Opening Range Breakout EA:
The Core Idea
Every session, the EA scans the chart looking for an NR7 bar. Once it spots one, it defines a compression zone using the high and low of that seven bar window, then arms itself and waits. The moment price ticks at least one pip beyond either edge of that zone, a trade fires in the direction of the breakout. The stop loss sits at the opposite end of the compression range, so every trade has a clean, predefined risk boundary from the second it's opened.
This isn't a scalper and it isn't trying to catch every wiggle in the market. On a 30 minute chart you're typically looking at one or two trades per instrument per day. The EA is built around quality setups, not trade frequency.
How the Logic Actually Works
The EA breaks the process into five steps:
- Session detection. Using SymbolInfoSessionTrade() , the EA reads your broker's actual session hours automatically, no manual configuration required. That means it adapts cleanly across forex, metals, crypto, and oil instruments without you having to hand tune session times for each symbol.
- NR7 scan. On every new bar, it checks whether the most recently closed candle is narrower than the prior six. If so, the high/low of that seven bar window becomes the compression zone.
- Breakout trigger. Once armed, the EA watches price tick by tick. A buy fires when the ask crosses one pip above the compression high; a sell fires when the bid crosses one pip below the compression low.
- Session boundary protection. No new trades are opened on the last candle of the session, and every open position is closed at session end. There's no overnight exposure and no rollover risk. This is a pure day trading system.
- Risk based position sizing. Lot size is calculated with OrderCalcProfit() so your risk percentage maps consistently to the stop distance, regardless of the instrument's contract size or broker-specific quirks.
Built-In Safeguards
A few details separate this from a quick and dirty breakout script:
- NR7 validation only uses bars from the current session, so there's no contamination from prior day data or overnight gaps.
- Freeze level, stop level, and margin checks all run before every order is sent.
- If the terminal restarts mid-session with a position already open, the EA recovers gracefully instead of losing track of the trade.
- Each symbol gets a unique magic number, so you can run it across multiple instruments at once without conflicts.
Where It Fits
The recommended setup is the M30 timeframe with 0.25–1% risk per trade, and it's been tested on FTMO, IC Markets, and Oanda. Recommended markets include major/minor forex pairs, gold and silver, Bitcoin and Ethereum, and US/UK crude.
There's no martingale, no grid, no averaging down. Every trade has a fixed stop defined before entry, which keeps the risk profile simple and auditable. You always know your worst case before you click (or let the EA click) "buy" or "sell."
Who It's For
This is built for traders who want a fully mechanical intraday system grounded in a well documented edge, volatility compression resolving into a directional breakout rather than discretionary opening range guesswork. If you're looking for a high frequency scalping bot, this isn't it. If you want a disciplined, session aware breakout system that handles its own risk sizing and exits cleanly every day, it's worth a look.
The EA is currently available on the MQL5 Market at an introductory price, with the companion NR7 Compression indicator available free to buyers on request.


