Buys when the close breaks above the high of a reference bar that resets on new lows. Closes the long when the close breaks below the low of a reference bar that resets on new highs.
Best run of 4. DAX 40, 4 hours, spread 3, from run sweeps:2026-10-11-DAX40-4h-opt.tsv:102.
| Period | Up to 2026-10-11 |
| Instrument | DAX 40, 4 hours |
| Spread | 3 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 |
|---|---|---|---|---|---|---|
| DAX 40Best run | 4 hours | n/a | 2,431 | 39.04 | 12,015 EUR | -4,725 |
| Dow Jones | Daily | n/a | 1,365 | 38.75 | 14,041 EUR | -9,219 |
| Nasdaq 100 | 4 hours | n/a | 2,368 | 38.18 | 13,105 EUR | -6,161 |
| Gold | 4 hours | n/a | 2,281 | 36.12 | 1,175 EUR | -1,155 |
Charts
The code
// ============================================================== // Reference Bar Structure Flip // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE init = 0 ONCE trend = 0 ONCE sh = 0 ONCE sl = 0 chup = 0 chdn = 0 IF init = 0 THEN
38 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 by trade count was DAX 40, 4 hours, with 2,431 trades.
The best run had a maximum drawdown of 4,725 EUR at the tested position size, against a net result of 12,015 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.