While flat, the system places a buy stop 5 points above the 10-bar high and a sell stop 5 points below the 10-bar low. Orders last one bar and are renewed each bar. Trades take a 10 point profit or a 60 point loss.
Best run of 6. Dow Jones, 4 hours, spread 3, from run pf:2026-09-15-DOW30-4h.tsv:2.
| Period | Up to 2026-09-15 |
| Instrument | Dow Jones, 4 hours |
| 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-15 |
| positionSize Contracts per trade | 1 |
| stopLossPoints Protective stop in points | 60 |
| takeProfitPoints Profit target in points | 10 |
| lookbackPeriod Bars for the range high and low | 10 |
| entryOffsetPoints Distance of the stop orders beyond the range, in points | 5 |
| warmupMultiplier Bars to wait before trading, as a multiple of lookbackPeriod | 2 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Dow JonesBest run | 4 hours | 1.64 | 808 | 90.84 | 2,867 EUR | -310 |
| GBP/USD | Daily | 1.63 | 1,023 | 90.91 | 3,604 USD | -310 |
| USD/JPY | Daily | 1.49 | 969 | 89.99 | 286,150 JPY | -46,000 |
| DAX 40 | Daily | 1.33 | 867 | 89.04 | 1,933 EUR | -381 |
| EUR/USD | Daily | 1.15 | 962 | 87.32 | 10,854 USD | -5,993 |
| USD/JPY | 4 hours | 1.14 | 2,313 | 87.25 | 251,420 JPY | -66,380 |
Charts
Above 1.0 made money, below 1.0 lost money.
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.
// ============================================================ // Range Breakout Pending // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 1000 // --- Parameters --- positionSize = 1 // contracts per trade stopLossPoints = 60 // protective stop in points takeProfitPoints = 10 // profit target in points lookbackPeriod = 10 // bars for the highest high / lowest low entryOffsetPoints = 5 // stop orders sit this many points beyond the range warmupMultiplier = 2 // wait lookbackPeriod times this many bars before trading // --- Indicators --- channelHigh = Highest[lookbackPeriod](high) channelLow = Lowest[lookbackPeriod](low) warmedUp = BarIndex >= lookbackPeriod * warmupMultiplier barsSinceTrade = BarIndex - TradeIndex(1)
13 more lines: the entry and exit rules.
Read this first
Questions
Yes. Pending stop orders are supported in ProOrder, and the code renews them every bar while flat.
Dow Jones 4 hours made 2,867.40 EUR over 808 trades. GBP/USD Daily, USD/JPY Daily, DAX 40 Daily, EUR/USD Daily and USD/JPY 4 hours were also positive.
Every loss is capped at 60 points. With 1 contract and a 3 point spread, the Dow Jones 4 hour run had a max drawdown of 310 EUR.
A 10 point target is small compared with the swing on slow bars, which is why the win rate is high there. On faster charts the spread would take a larger share.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.