On the first bar of each day, the system places a buy stop at the 120 bar high and a sell stop at the 120 bar low. Only one trade is allowed per day. It aims for 35 points with a 60 point hard stop.
Best run of 39. Brent Crude, Daily, spread 3, from run pf:2026-09-15-BRENT-D.tsv:3.
| Period | Up to 2026-09-15 |
| Instrument | Brent Crude, 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-16 |
| stopDistance Price distance of the managed stop and the profit target | 35 |
| rangeBars Bars in the breakout range, taken at the first bar of each day | 120 |
| stopLossPoints Hard protective stop in points | 60 |
| profitStep Size resets to 1 each time strategy profit gains this much | 20 |
| positionSize Contracts; grows after a loss, shrinks after a win | 1 |
| profitMark Strategy profit level that triggers the next size reset | 20 |
| inTrade Seed for the in-trade flag, so size is not adjusted before the first trade | 1 |
| sizeAdjusted Seed for the size-adjusted flag, so size is not adjusted before the first trade | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Brent CrudeBest run | Daily | 1.89 | 434 | 74.19 | 7,714 EUR | -719 |
| USD/JPY | Daily | 1.86 | 1,089 | 76.12 | 1,338,700 JPY | -76,500 |
| GBP/USD | Daily | 1.70 | 1,094 | 74.31 | 18,262 USD | -1,989 |
| Dow Jones | 4 hours | 1.68 | 626 | 71.73 | 10,622 EUR | -1,550 |
| Gold | 10 min | 1.43 | 468 | 55.77 | 7,053 EUR | -1,102 |
| Gold | Daily | 1.39 | 278 | 60.43 | 4,570 EUR | -2,200 |
| Gold | 15 min | 1.37 | 528 | 54.55 | 7,646 EUR | -1,961 |
| Silver | Daily | 1.34 | 425 | 60.71 | 29,069 USD | -6,934 |
| Dow Jones | 1 hour | 1.33 | 1,065 | 61.60 | 15,281 EUR | -1,498 |
| DAX 40 | Daily | 1.30 | 954 | 62.79 | 12,668 EUR | -2,732 |
| US Crude Oil | 4 hours | 1.29 | 1,044 | 59.87 | 15,081 EUR | -2,352 |
| Silver | 4 hours | 1.28 | 857 | 56.01 | 56,137 USD | -7,984 |
| Brent Crude | 4 hours | 1.28 | 743 | 61.24 | 9,972 EUR | -3,412 |
| USD/JPY | 10 min | 1.25 | 915 | 66.78 | 802,240 JPY | -282,690 |
| EUR/USD | Daily | 1.23 | 1,054 | 67.46 | 87,805 USD | -28,557 |
| Gold | 4 hours | 1.23 | 468 | 52.99 | 6,138 EUR | -3,127 |
| USD/JPY | 15 min | 1.21 | 1,114 | 67.24 | 865,410 JPY | -238,610 |
| Nikkei 225 | Daily | 1.21 | 1,160 | 73.10 | 12,846 USD | -5,694 |
| Gold | 5 min | 1.21 | 364 | 54.95 | 4,571 EUR | -3,052 |
| Dow Jones | 30 min | 1.19 | 1,347 | 58.95 | 17,804 EUR | -6,660 |
| Gold | 1 hour | 1.18 | 728 | 52.88 | 8,638 EUR | -3,600 |
| S&P 500 | Daily | 1.18 | 409 | 54.28 | 4,457 EUR | -2,346 |
| USD/JPY | 5 min | 1.16 | 522 | 64.94 | 325,240 JPY | -130,880 |
| GBP/USD | 4 hours | 1.15 | 1,637 | 64.94 | 13,171 USD | -3,585 |
| Nasdaq 100 | 4 hours | 1.13 | 1,235 | 57.00 | 12,906 EUR | -9,310 |
| Gold | 30 min | 1.13 | 724 | 51.80 | 7,513 EUR | -4,038 |
| USD/JPY | 4 hours | 1.12 | 1,129 | 64.48 | 438,870 JPY | -180,040 |
| USD/JPY | 1 hour | 1.11 | 2,058 | 64.82 | 922,930 JPY | -335,090 |
| US Crude Oil | 1 hour | 1.11 | 1,896 | 54.54 | 20,962 EUR | -7,692 |
| Nasdaq 100 | 10 min | 1.11 | 1,268 | 52.68 | 13,948 EUR | -7,963 |
| Nasdaq 100 | 15 min | 1.10 | 1,808 | 52.32 | 18,077 EUR | -13,562 |
| Brent Crude | 1 hour | 1.10 | 1,365 | 53.48 | 14,300 EUR | -10,534 |
| S&P 500 | 30 min | 1.10 | 1,193 | 51.55 | 11,913 EUR | -7,131 |
| US Crude Oil | 30 min | 1.08 | 2,426 | 52.93 | 26,200 EUR | -19,195 |
| USD/JPY | 30 min | 1.07 | 1,812 | 65.18 | 588,350 JPY | -559,030 |
| S&P 500 | 15 min | 1.07 | 1,087 | 50.41 | 7,498 EUR | -4,808 |
| EUR/USD | 4 hours | 1.06 | 1,525 | 64.20 | 66,798 USD | -60,183 |
| GBP/USD | 1 hour | 1.06 | 3,058 | 63.87 | 11,410 USD | -7,294 |
| USD/JPY | 1 min | n/a | 87 | 68.97 | 122,500 JPY | -50,710 |
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.
// ============================================================ // Morning Range Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 1000 // --- Parameters --- stopDistance = 35 // price distance of the managed stop and the profit target rangeBars = 120 // bars in the breakout range, taken at the first bar of each day stopLossPoints = 60 // hard protective stop in points profitStep = 20 // size resets to 1 each time strategy profit gains this much ONCE positionSize = 1 // contracts; grows after a loss, shrinks after a win ONCE profitMark = 20 // strategy profit level that triggers the next size reset ONCE inTrade = 1 // start as if in a trade, so no size change before the first trade ONCE sizeAdjusted = 1 // start as already adjusted, same reason // --- Indicators --- weekendBar = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0 // New day: allow one trade and capture the range. IF Day <> Day[1] THEN tradeTaken = 0 rangeHigh = Highest[rangeBars](high) rangeLow = Lowest[rangeBars](low) ENDIF
61 more lines: the entry and exit rules.
Read this first
Questions
Yes. The stop orders, targets and the sizing logic are all in the code, and it takes at most one trade per day.
Brent Crude Daily was best with a profit factor of 1.89. USD/JPY Daily (1.86), GBP/USD Daily (1.7) and Dow Jones 4 hours (1.68) followed, and almost every other row was above 1.
The worst drawdown on Brent Crude Daily was 718.9 EUR, starting from 1 contract. Since size increases after losses, a longer losing run than the backtest had would cost more than that.
On daily charts every bar is the first bar of a new day, so the system can set new orders each session. Intraday charts like Gold 10 minutes also worked, with a profit factor of 1.43.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.