The system tracks a trailing line that moves up or down when price breaks outside a 21-period Bollinger Band, using a 5-period ATR offset. It buys when the line turns up and sells short when it turns down, reversing any open position.
Best run of 9. Gold, 30 min, spread 0.6, from run sweeps:2026-10-12-GOLD-30m-opt.tsv:44.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 30 minutes |
| Spread | 0.6 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | n/a | 4,583 | 36.22 | 1,675 EUR | -1,466 |
| Nikkei 225 | Daily | n/a | 358 | 37.43 | 23,157 USD | -20,826 |
| Brent Crude | Daily | n/a | 137 | 40.88 | 19,512 EUR | -9,169 |
| Dow Jones | 1 hour | n/a | 963 | 38.53 | 17,804 EUR | -6,962 |
| Nasdaq 100 | Daily | n/a | 331 | 36.56 | 11,711 EUR | -5,676 |
| US Crude Oil | 30 min | n/a | 4,179 | 37.38 | 6,901 EUR | -6,794 |
| Gold | 4 hours | n/a | 801 | 39.20 | 3,431 EUR | -913 |
| Gold | Daily | n/a | 416 | 35.34 | 2,958 EUR | -1,365 |
| Gold | 1 hour | n/a | 2,829 | 36.23 | 2,635 EUR | -976 |
Charts
The code
// ============================================================== // Follow Line Trend Flip // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE line = 0 ONCE hasline = 0 ONCE trend = 0 basis = Average[21](close) dev = STD[21](close) * 1.0 myAtr = AverageTrueRange[5](close)
51 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 9 market and timeframe combinations. The best run by trade count was Gold, 30 minutes, with 4,583 trades.
The best run had a maximum drawdown of 1,466 EUR at the tested position size, against a net result of 1,675 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.