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.
Best run of 8. Nikkei 225, 1 hour, spread 10, from run sweeps:2026-09-17-NIKKEI-1h-opt.tsv:2.
| Period | Up to 2026-09-17 |
| Instrument | Nikkei 225, 1 hour |
| Spread | 10 points |
| Contracts | 2 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-17 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | 1 hour | n/a | 957 | 6.69 | 21,548 USD | -12,128 |
| DAX 40 | Daily | n/a | 331 | 14.80 | 19,755 EUR | -3,553 |
| Nikkei 225 | 1 min | n/a | 70 | 1.43 | 3,777 USD | -2,654 |
| Gold | 5 min | n/a | 52 | 15.38 | 3,519 EUR | -1,726 |
| S&P 500 | 1 hour | n/a | 377 | 16.45 | 1,985 EUR | -1,825 |
| Gold | 10 min | n/a | 64 | 10.94 | 1,918 EUR | -1,349 |
| Gold | 15 min | n/a | 96 | 14.58 | 1,895 EUR | -1,220 |
| S&P 500 | 5 min | n/a | 80 | 7.50 | 798 EUR | -752 |
Charts
The code
// ============================================================ // 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.
Setup
Questions
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.
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.
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.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.