Tracks a trailing line 2.0 times the 14-period ATR from the close, which flips side when price crosses it. Goes long on a flip up when the close is above the 200-period EMA, and short on a flip down when it is below.
Best run of 20. Gold, 3 min, spread 0.6, from run pf:2026-10-04-GOLD-3m.tsv:1.
| Period | Up to 2026-10-04 |
| Instrument | Gold, 3 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 3 min | 1.41 | 1,507 | 27.27 | 4,422 EUR | -740 |
| USD/JPY | Daily | n/a | 95 | 33.68 | 2,114,430 USD | -848,800 |
| USD/JPY | 1 hour | n/a | 1,008 | 27.68 | 790,320 USD | -318,130 |
| USD/JPY | 10 min | n/a | 1,549 | 25.95 | 321,360 USD | -201,350 |
| EUR/USD | Daily | n/a | 72 | 47.22 | 218,224 USD | -41,810 |
| Nikkei 225 | Daily | n/a | 79 | 32.91 | 54,679 USD | -16,107 |
| Nasdaq 100 | Daily | n/a | 74 | 33.78 | 24,073 EUR | -5,520 |
| DAX 40 | Daily | n/a | 110 | 28.18 | 15,800 EUR | -10,002 |
| GBP/USD | Daily | n/a | 100 | 29.00 | 14,039 USD | -6,560 |
| US Crude Oil | Daily | n/a | 84 | 30.95 | 12,980 EUR | -7,285 |
| GBP/USD | 1 hour | n/a | 1,354 | 27.25 | 7,544 USD | -3,634 |
| GBP/USD | 4 hours | n/a | 387 | 27.39 | 4,412 USD | -4,302 |
| Gold | Daily | n/a | 97 | 23.71 | 3,418 EUR | -1,978 |
| S&P 500 | Daily | n/a | 91 | 36.26 | 2,873 EUR | -1,691 |
| Gold | 5 min | n/a | 1,559 | 24.82 | 2,839 EUR | -899 |
| Gold | 10 min | n/a | 1,543 | 23.98 | 2,772 EUR | -1,027 |
| Gold | 30 min | n/a | 1,518 | 27.73 | 2,197 EUR | -1,581 |
| Gold | 1 hour | n/a | 918 | 26.25 | 1,622 EUR | -1,521 |
| Gold | 2 min | n/a | 1,560 | 24.74 | 1,493 EUR | -955 |
| Gold | 15 min | n/a | 1,601 | 22.61 | 1,424 EUR | -1,058 |
Charts
Top 10 of 20 runs. The full list is in the table above.
The code
// ============================================================== // ATR Trail Flip Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 3 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE trail = 0 ONCE uptrend = 1 ONCE init = 0 myAtr = AverageTrueRange[14](close) ema = ExponentialAverage[200](close) longstop = close - myAtr * 2.0 shortstop = close + myAtr * 2.0 prevup = uptrend
40 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 20 market and timeframe combinations. The best run was Gold, 3 minutes, with a profit factor of 1.41 over 1,507 trades.
The best run had a maximum drawdown of 740 EUR at the tested position size, against a net result of 4,422 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.