After price pulls back 20% of the day's range, a buy stop sits 7 points under the high, or a sell stop 7 points above the low after a bounce. The range must be 120 points or less and the levels 60 points apart, and Mondays are skipped. Winners are managed with a trailing stop of 22 points for longs and 21 for shorts.
Best run of 18. Dow Jones, Daily, spread 3, from run sweeps:2026-09-16-DOW30-D-opt.tsv:3.
| Period | Up to 2026-09-16 |
| Instrument | Dow Jones, Daily |
| Spread | 3 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 |
| skipDay Day of week with no new entries (1 = Monday) | 1 |
| maxAmplitude Skip days whose range is wider than this, points | 120 |
| minAmplitude Minimum gap between the two entry levels, points | 60 |
| orderDistance Entry level offset inside the range, points | 7 |
| minPullbackPct Pullback from the range extreme, percent of range, before a level is set | 20 |
| longTrailPoints Trailing distance on longs, points | 22 |
| shortTrailPoints Trailing distance on shorts, points | 21 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Dow JonesBest run | Daily | n/a | 963 | 61.99 | 20,020 EUR | -2,607 |
| Nikkei 225 | Daily | n/a | 531 | 56.12 | 16,448 USD | -2,304 |
| US Crude Oil | Daily | n/a | 865 | 60.23 | 6,785 EUR | -2,214 |
| Silver | 4 hours | n/a | 157 | 71.34 | 5,821 USD | -4,653 |
| Brent Crude | Daily | n/a | 549 | 57.74 | 4,848 EUR | -1,906 |
| Silver | 1 hour | n/a | 74 | 74.32 | 3,963 USD | -3,401 |
| Nasdaq 100 | Daily | n/a | 272 | 65.44 | 3,607 EUR | -1,293 |
| Nikkei 225 | 1 min | n/a | 43 | 83.72 | 1,287 USD | -357 |
| Gold | Daily | n/a | 53 | 71.70 | 1,141 EUR | -477 |
| Brent Crude | 5 min | n/a | 33 | 93.94 | 379 EUR | -287 |
| Nasdaq 100 | 1 min | n/a | 22 | 81.82 | 241 EUR | -206 |
| Brent Crude | 1 min | n/a | 7 | 100.00 | 183 EUR | -163 |
| Gold | 30 min | n/a | 3 | 100.00 | 91.70 EUR | -61.90 |
| Gold | 5 min | n/a | 2 | 100.00 | 89.40 EUR | -68.80 |
| Gold | 10 min | n/a | 2 | 100.00 | 88.70 EUR | -63.50 |
| Gold | 15 min | n/a | 2 | 100.00 | 86.90 EUR | -61.90 |
| S&P 500 | 2 min | n/a | 3 | 100.00 | 65.44 EUR | -61.94 |
| FTSE 100 | 5 min | n/a | 1 | 100.00 | 27.40 EUR | -21.00 |
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.
// ============================================================ // DAX Range Breakout Trailing // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 10000 // --- Parameters --- positionSize = 1 // contracts per trade skipDay = 1 // day of week with no new entries (1 = Monday) maxAmplitude = 120 // skip days whose range is wider than this, in points minAmplitude = 60 // entry levels must be at least this far apart, in points orderDistance = 7 // entry level offset inside the range, in points minPullbackPct = 20 // price must pull back this share of the range before a level is set longTrailPoints = 22 // trailing distance on longs, in points shortTrailPoints = 21 // trailing distance on shorts, in points // No trading until the first new session has started. ONCE sessionStarted = -1 // --- Indicators --- IF DayOfWeek = skipDay THEN dayAllowed = 0 ELSE dayAllowed = 1 ENDIF // Reset the day's levels on the first bar of each session. IF IntradayBarIndex = 0 THEN longEntryLevel = 0 shortEntryLevel = 0 longTaken = 0 shortTaken = 0 sessionStarted = 1 ENDIF // Set each entry level once price has pulled back far enough from the range extreme. IF sessionStarted = 1 AND dayAllowed = 1 THEN IF longEntryLevel = 0 OR shortEntryLevel = 0 THEN rangeHigh = Highest[IntradayBarIndex + 1](high) rangeLow = Lowest[IntradayBarIndex + 1](low) rangeSize = rangeHigh - rangeLow minPullback = rangeSize * minPullbackPct / 100 IF rangeSize <= maxAmplitude THEN IF shortEntryLevel = 0 AND (close - rangeLow) >= minPullback THEN shortEntryLevel = rangeLow + orderDistance ENDIF IF longEntryLevel = 0 AND (rangeHigh - close) >= minPullback THEN longEntryLevel = rangeHigh - orderDistance ENDIF ENDIF ENDIF ENDIF
51 more lines: the entry and exit rules.
Read this first
Questions
Yes, it uses stop orders, a trailing stop and a hard stop, all supported in ProOrder. The rewritten code is not compile-checked yet, so demo test it first.
The best run was Dow Jones Daily with EUR 20,019.9 over 963 trades. Nikkei 225 Daily made USD 16,448.1 and US Crude Oil Daily EUR 6,785.2, while the intraday runs on S&P 500 and FTSE 100 took only a handful of trades.
The Dow Jones Daily run had a max drawdown of EUR 2,607.4 with 1 contract. Silver 4 hours saw USD 4,653.0 of drawdown.
On Daily bars the range filter and levels come from one bar, which effectively turns it into a different, simpler system. Test the intraday timeframe yourself before relying on it.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.