When price closes above the previous day high, the system goes long, and below the previous day low it goes short. It exits when price closes back through the middle of the previous day range, or at a 1% stop. Only one position is open at a time.
Best run of 16. Gold, 30 min, spread 0.6, from run pf:2026-09-15-GOLD-30m.tsv:3.
| Period | Up to 2026-09-15 |
| Instrument | Gold, 30 minutes |
| Spread | 0.6 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 |
| stopLossPct Protective stop, percent | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | 1.08 | 3,742 | 31.37 | 1,594 EUR | -963 |
| DAX 40 | 1 hour | 1.05 | 4,036 | 32.90 | 7,921 EUR | -7,129 |
| DAX 40 | 30 min | n/a | 4,004 | 30.72 | 6,913 EUR | -7,185 |
| Nasdaq 100 | 15 min | n/a | 1,883 | 31.12 | 4,378 EUR | -6,029 |
| Nasdaq 100 | 5 min | n/a | 673 | 31.50 | 2,690 EUR | -5,634 |
| DAX 40 | 15 min | n/a | 2,286 | 28.08 | 763 EUR | -7,442 |
| Gold | 5 min | n/a | 801 | 28.59 | 594 EUR | -693 |
| Gold | 1 hour | n/a | 3,922 | 31.87 | 535 EUR | -920 |
| Gold | 15 min | n/a | 2,098 | 28.27 | 311 EUR | -1,059 |
| S&P 500 | 15 min | n/a | 1,855 | 31.91 | -311 EUR | -1,678 |
| S&P 500 | 5 min | n/a | 691 | 29.96 | -422 EUR | -1,744 |
| DAX 40 | 5 min | n/a | 932 | 25.54 | -1,415 EUR | -5,577 |
| S&P 500 | 30 min | n/a | 3,529 | 32.22 | -1,926 EUR | -2,886 |
| Nasdaq 100 | 30 min | n/a | 3,637 | 31.65 | -2,040 EUR | -7,283 |
| S&P 500 | 1 hour | n/a | 4,022 | 31.53 | -3,361 EUR | -3,589 |
| Nasdaq 100 | 1 hour | n/a | 4,126 | 29.96 | -7,484 EUR | -10,644 |
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.
// ============================================================ // Previous Day 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 stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- prevDayHigh = DHigh(1) prevDayLow = DLow(1) prevDayMid = (prevDayHigh + prevDayLow) / 2
26 more lines: the entry and exit rules.
Read this first
Questions
Yes. It is a simple intraday system trading 1 contract with a 1% stop.
Gold 30 minutes led with EUR 1,593.60 and profit factor 1.08. DAX 40 1 hour made EUR 7,921.20, while S&P 500 lost on every timeframe tested.
On Gold 30 minutes the max drawdown was EUR 963.10 at 1 contract. DAX 40 and Nasdaq 100 runs went much deeper.
They confirm a break of the previous day level without waiting too long. Faster Gold charts made less and slower DAX 40 charts had bigger swings.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.