When price pulls back at least 35% of the day's range from the high, a buy stop is placed 4 points under that high, with a mirrored sell stop above the low. The day's range must stay at or below 160 points and the two levels at least 20 apart. It skips May 1 and the late December holidays, and each side trades once per day.
Best run of 12. Nikkei 225, 30 min, spread 10, from run sweeps:2026-09-17-NIKKEI-30m-opt.tsv:2.
| Period | Up to 2026-09-17 |
| Instrument | Nikkei 225, 30 minutes |
| Spread | 10 points |
| Contracts | 1 |
| 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 | 1 |
| maxRangePoints No new levels if today's range is wider than this; also the stop loss in points | 160 |
| minLevelGap Minimum distance between the buy and sell levels | 20 |
| orderDistance Entry levels sit this many points inside the day's high and low | 4 |
| minPullbackPct Pullback from an extreme, as percent of the day's range, needed to set that level | 35 |
| rangeExtraBars Bars added to today's bar count for the high/low window | 2 |
| mayMonth / mayDay / decemberMonth / christmasEve / christmasDay / boxingDay / yearEndEve / newYearsEve Holiday calendar dates with no trading | 5 / 1 / 12 / 24 / 25 / 26 / 30 / 31 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | 30 min | n/a | 3,646 | 17.53 | 29,850 USD | -8,138 |
| Nikkei 225 | 1 hour | n/a | 3,055 | 23.24 | 18,297 USD | -8,884 |
| Nikkei 225 | Daily | n/a | 172 | 19.77 | 10,782 USD | -8,276 |
| DAX 40 | Daily | n/a | 619 | 36.83 | 7,816 EUR | -5,105 |
| Nasdaq 100 | 30 min | n/a | 1,719 | 18.44 | 5,659 EUR | -5,120 |
| Nasdaq 100 | Daily | n/a | 479 | 39.46 | 5,029 EUR | -2,144 |
| Gold | 10 min | n/a | 75 | 33.33 | 2,089 EUR | -692 |
| Gold | 5 min | n/a | 57 | 31.58 | 1,760 EUR | -1,539 |
| FTSE 100 | 5 min | n/a | 63 | 28.57 | 1,710 EUR | -889 |
| Gold | 30 min | n/a | 110 | 36.36 | 1,482 EUR | -1,456 |
| FTSE 100 | 1 min | n/a | 23 | 34.78 | 1,089 EUR | -445 |
| S&P 500 | 1 min | n/a | 14 | 42.86 | 458 EUR | -425 |
Charts
The code
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.
// ============================================================ // Intraday Range Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 10000 // --- Parameters --- positionSize = 1 // contracts per trade maxRangePoints = 160 // no orders if today's range is wider than this; also the stop loss minLevelGap = 20 // buy and sell levels must be at least this far apart orderDistance = 4 // entry levels sit this many points inside the day's extremes minPullbackPct = 35 // price must pull back this percent of the range from an extreme rangeExtraBars = 2 // bars added to today's bar count for the range window mayMonth = 5 // holiday calendar: May mayDay = 1 // May 1 decemberMonth = 12 // holiday calendar: December christmasEve = 24 christmasDay = 25 boxingDay = 26 yearEndEve = 30 newYearsEve = 31 ONCE dayStarted = -1 ONCE longDone = 0 ONCE shortDone = 0 // --- Indicators --- // No trading on holidays and thin year-end sessions. IF (Month = mayMonth AND Day = mayDay) OR (Month = decemberMonth AND (Day = christmasEve OR Day = christmasDay OR Day = boxingDay OR Day = yearEndEve OR Day = newYearsEve)) THEN tradingDay = 0 ELSE tradingDay = 1 ENDIF
56 more lines: the entry and exit rules.
Read this first
Questions
It runs on stop orders that ProOrder supports, and both can be live at once. The code was rewritten after testing and has not been compile-checked yet.
All 11 rows in the table were profitable. Nikkei 225 led, with USD 18,297.2 on 1 hour, and DAX 40 Daily made EUR 7,815.6, while S&P 500 1 minute took only 14 trades.
The best run had a max drawdown of USD 8,137.8 with 1 contract, and Nikkei 225 1 hour saw USD 8,883.9.
The levels come from the day's high, low and a 35% pullback, which needs a few bars to form. On 30 minutes that happens most days without the noise of 1 minute bars.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.