The strategy buys when a SuperTrend band built from 3.0 times ATR(10) flips to an uptrend and sells short when it flips to a downtrend. Each flip reverses the open position.
Best run of 13. Gold, 4 hours, spread 0.6, from run pf:2026-10-04-GOLD-4h.tsv:8.
| Period | Up to 2026-10-04 |
| Instrument | Gold, 4 hours |
| 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 | 4 hours | 1.39 | 826 | 40.19 | 3,958 EUR | -938 |
| USD/JPY | Daily | n/a | 401 | 37.91 | 1,470,150 USD | -582,140 |
| USD/JPY | 1 hour | n/a | 3,382 | 37.20 | 453,750 USD | -322,870 |
| EUR/USD | Daily | n/a | 362 | 39.50 | 116,546 USD | -42,679 |
| Brent Crude | Daily | n/a | 153 | 41.83 | 21,238 EUR | -6,655 |
| Dow Jones | 4 hours | n/a | 292 | 39.38 | 18,327 EUR | -11,871 |
| DAX 40 | 30 min | n/a | 5,421 | 36.51 | 14,564 EUR | -6,216 |
| Nasdaq 100 | Daily | n/a | 365 | 34.79 | 12,861 EUR | -5,381 |
| US Crude Oil | Daily | n/a | 350 | 41.43 | 12,563 EUR | -7,703 |
| Brent Crude | 1 hour | n/a | 1,785 | 38.54 | 6,180 EUR | -5,638 |
| Gold | 30 min | n/a | 4,895 | 35.51 | 2,156 EUR | -1,988 |
| Gold | Daily | n/a | 392 | 39.29 | 1,819 EUR | -1,282 |
| Gold | 1 hour | n/a | 2,942 | 36.91 | 1,587 EUR | -884 |
Charts
Top 10 of 13 runs. The full list is in the table above.
The code
// ============================================================== // SuperTrend Flip Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE lower = 0 ONCE upper = 0 ONCE super = 0 ONCE dir = 1 myAtr = AverageTrueRange[10](close) mid = (high + low) / 2 newup = mid + 3.0 * myAtr newlow = mid - 3.0 * myAtr prevdir = dir IF BarIndex = 10 THEN lower = newlow upper = newup dir = 1 super = newup
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 13 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 1.39 over 826 trades.
The best run had a maximum drawdown of 938 EUR at the tested position size, against a net result of 3,958 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.