Join today
Strategies / Breakout / Opening Range Breakout

Opening Range Breakout

Each day the system tracks the high and low from the first bar. After price pulls back at least 30% of that range, it places a stop order 4 points inside the range edge and trades the break once per day. Days with a range wider than 32.5 points are skipped, and the same 32.5 points is the stop.

BreakoutLong & shortSwingNikkei 2251 hour
n/aProfit factor
21,548Net profit USD
6.69%Win rate
957Trades
-12,128Max drawdown
22.52Avg trade

Best run of 8. Nikkei 225, 1 hour, spread 10, from run sweeps:2026-09-17-NIKKEI-1h-opt.tsv:2.

Entry rules, long

  1. Each day, track the high and low since the first bar of the day
  2. Members only
  3. Both levels must be set, the day range must be at most 32.5 points and the two levels at least 11 points apart
  4. Buy on a break of the buy stop, only once per day

Entry rules, short

  1. Once price has bounced at least 30% of the day range from the low, arm a sell stop 4 points above the day low
  2. Members only
  3. Sell short on a break of the sell stop, only once per day

Exit rules

  1. Stop loss 32.5 points
  2. Members only

Test conditions

PeriodUp to 2026-09-17
InstrumentNikkei 225, 1 hour
Spread10 points
Contracts2
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-17

Parameters

positionSize
Contracts per trade
2
maxAmplitude
Widest day range still traded, also the stop in points
32.5
minAmplitude
Minimum gap between the two entry levels
11
orderDistance
Entry levels sit this far inside the range edges
4
minRangePct
Price must pull back this share of the range before a level is set
30

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nikkei 225Best run1 hourn/a 9576.6921,548 USD-12,128
DAX 40Dailyn/a 33114.8019,755 EUR-3,553
Nikkei 2251 minn/a 701.433,777 USD-2,654
Gold5 minn/a 5215.383,519 EUR-1,726
S&P 5001 hourn/a 37716.451,985 EUR-1,825
Gold10 minn/a 6410.941,918 EUR-1,349
Gold15 minn/a 9614.581,895 EUR-1,220
S&P 5005 minn/a 807.50798 EUR-752

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-20K-10K13K25KNikkei 225 · 1 hourDAX 40 · DailyNikkei 225 · 1 minGold · 5 minS&P 500 · 1 hourGold · 10 minGold · 15 minS&P 500 · 5 min

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Opening Range Breakout
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 1 hour
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 10000

// --- Parameters ---
positionSize = 2          // contracts per trade
maxAmplitude = 32.5       // widest day range still traded, also the stop in points
minAmplitude = 11         // minimum gap between the two entry levels
orderDistance = 4         // entry levels sit this far inside the range edges
minRangePct = 30          // price must pull back this share of the range before a level is set

// --- Indicators ---
ONCE sessionStarted = -1

// Holiday calendar: no trading on 1 May and on 24, 25, 26, 30 and 31 December.
IF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THEN
  tradingDay = 0
ELSE
  tradingDay = 1
ENDIF

// New day: clear both entry levels and fill flags.
IF IntradayBarIndex = 0 THEN
  buyThreshold = 0
  sellThreshold = 0
  longFilled = 0
  shortFilled = 0
  sessionStarted = 1
ENDIF

// Build today's range until both entry levels are set.
IF sessionStarted = 1 AND tradingDay = 1 THEN
  IF buyThreshold = 0 OR sellThreshold = 0 THEN
    rangeHigh = Highest[IntradayBarIndex + 1](high)
    rangeLow = Lowest[IntradayBarIndex + 1](low)
    daySpread = rangeHigh - rangeLow
    minSpread = daySpread * minRangePct / 100

    IF daySpread <= maxAmplitude THEN
      IF sellThreshold = 0 AND (close - rangeLow) >= minSpread THEN
        sellThreshold = rangeLow + orderDistance
      ENDIF
      IF buyThreshold = 0 AND (rangeHigh - close) >= minSpread THEN
        buyThreshold = rangeHigh - orderDistance
      ENDIF
    ENDIF
  ENDIF
ENDIF

30 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Win rate is very low: 6.69% in the best run on Nikkei 225 1 hour, and 1.43% on Nikkei 225 1 minute. Profits rely on a few large winners.
  • Profit factor was not recorded for any market. Every row is sweep data.
  • Some rows have very few trades, for example 52 on Gold 5 minutes and 70 on Nikkei 225 1 minute, which is too few to trust.
  • It trades 2 contracts per signal and uses a fixed point stop, so the risk per trade changes a lot between instruments.

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Does it run in ProOrder?

Yes, it uses pending stop orders that ProOrder supports. The code was rewritten and not yet compile-checked, and the stats are from the version before that.

What were the results by market?

Best was Nikkei 225 on 1 hour with USD 21,548.40 over 957 trades. DAX 40 Daily made EUR 19,755.40 over 331 trades, and Gold and S&P 500 were smaller but positive.

How much capital should I plan for?

The test used 2 contracts per trade. The best run's max drawdown at that size was USD 12,128.20, so halve the size if you want roughly half that exposure.

Why wait for a pullback before arming the order?

Requiring a 30% pullback from the day extreme means the level is only set after the market has shown both sides of the range, which filters out one-way days.

Related

Strategies like this one

Monday Dip Buy

Best run on the same market, Nikkei 225.

n/a PF · 146 trades

Breakout Regime Filter

Also a breakout strategy.

6.28 PF · 70 trades

Bollinger Band Walk

Also a breakout strategy.

3.10 PF · 148 trades

See how day range systems like this sit next to swing strategies. Join the ProRealAlgos waitlist.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs