It buys when the close breaks above the highest high of the previous 20 bars and sells when it breaks below the lowest low of the previous 10 bars. Only one position is open at a time.
Best run of 4. Brent Crude, Daily, spread 5, from run pf:2026-10-10-BRENT-D.tsv:2.
| Period | Up to 2026-10-10 |
| Instrument | Brent Crude, Daily |
| Spread | 5 points |
| 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-10-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Brent CrudeBest run | Daily | 1.73 | 81 | 45.68 | 15,553 EUR | -10,325 |
| Gold | Daily | 1.61 | 209 | 39.23 | 20,556 EUR | -9,823 |
| US Crude Oil | Daily | 1.45 | 178 | 45.51 | 21,152 EUR | -11,084 |
| EUR/USD | Daily | 1.39 | 187 | 43.85 | 6,029 USD | -3,253 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // 20 Day Breakout Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE capital = 10000
18 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 4 market and timeframe combinations. The best run was Brent Crude, Daily, with a profit factor of 1.73 over 81 trades.
The best run had a maximum drawdown of 10,325 EUR at the tested position size, against a net result of 15,553 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.