Once price has pulled back 19% of the day's range from the high, a buy stop goes in 9 points under that high, and the mirror rule sets a sell stop above the low. The day's range must stay at or under 170 and the two levels must sit at least 22 apart. Each side trades at most once a day, and the opposite level doubles as the stop after the first trade.
Best run of 11. Nikkei 225, 30 min, spread 10, from run sweeps:2026-09-17-NIKKEI-30m-opt.tsv:4.
| 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 |
| pullbackPct Pullback from a range extreme that arms that side, % of range | 19 |
| maxRangePoints Skip days whose range is already wider than this | 170 |
| entryOffset Entry level sits this far inside the range extreme | 9 |
| minLevelGap Minimum distance between buy and sell levels | 22 |
| stopLossPoints Protective stop (points) | 170 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | 30 min | n/a | 3,097 | 19.92 | 25,932 USD | -8,887 |
| Silver | 4 hours | n/a | 906 | 37.86 | 24,990 USD | -17,219 |
| Nasdaq 100 | 4 hours | n/a | 1,493 | 33.82 | 9,990 EUR | -4,210 |
| Brent Crude | 15 min | n/a | 635 | 13.70 | 7,493 EUR | -2,323 |
| Nasdaq 100 | 15 min | n/a | 670 | 11.64 | 7,158 EUR | -3,309 |
| Nikkei 225 | 4 hours | n/a | 1,596 | 31.33 | 6,987 USD | -6,663 |
| Nasdaq 100 | 3 min | n/a | 196 | 9.18 | 3,777 EUR | -2,241 |
| Gold | 30 min | n/a | 35 | 31.43 | 3,141 EUR | -1,109 |
| S&P 500 | 1 hour | n/a | 87 | 31.03 | 2,558 EUR | -1,629 |
| DAX 40 | 5 min | n/a | 121 | 10.74 | 2,168 EUR | -1,788 |
| DAX 40 | 3 min | n/a | 93 | 10.75 | 1,700 EUR | -1,599 |
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.
// ============================================================ // Daily Range Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade pullbackPct = 19 // pullback from a range extreme that arms that side, % of range maxRangePoints = 170 // skip days whose range is already wider than this entryOffset = 9 // entry level sits this far inside the range extreme minLevelGap = 22 // minimum distance between buy and sell levels stopLossPoints = 170 // protective stop (points) ONCE rangeState = -1 // -1 before the first day, 0 new day, 1 range building // --- Indicators --- // No trading on 1 May and over Christmas / New Year. 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 isTradingDay = 0 ELSE isTradingDay = 1 ENDIF
56 more lines: the entry and exit rules.
Read this first
Questions
Yes. It uses stop orders and a fixed stop loss, which ProOrder handles directly. The code was rewritten after the tests and is not compile-checked yet.
The top run was Nikkei 225 on 30 minutes with USD 25,932.3 over 3,097 trades. Silver 4 hours made USD 24,989.5 but with a USD 17,219.0 drawdown.
On the best run 1 contract saw a max drawdown of USD 8,887.2. Smaller tests like DAX 40 5 minutes had EUR 1,788.2 drawdown on only 121 trades.
The levels depend on the day's high, low and pullback, and 30 minute bars give enough structure for that while avoiding the constant level changes of 1 or 3 minute bars.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.