The system follows a Supertrend on median price, 3.0 times ATR. It buys when the trend flips up with close above the 200-period average, and sells short when it flips down with close at or below that average.
Best run of 22. Gold, 4 hours, spread 0.6, from run pf:2026-10-05-GOLD-4h.tsv:8.
| Period | Up to 2026-10-05 |
| 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | 1.77 | 422 | 41.71 | 3,584 EUR | -452 |
| EUR/USD | Daily | 1.66 | 185 | 44.86 | 141,203 USD | -26,552 |
| USD/JPY | Daily | n/a | 200 | 40.00 | 1,554,640 USD | -435,330 |
| USD/JPY | 1 hour | n/a | 1,756 | 38.44 | 519,360 USD | -234,300 |
| USD/JPY | 30 min | n/a | 2,513 | 36.69 | 281,240 USD | -173,770 |
| USD/JPY | 15 min | n/a | 2,652 | 36.43 | 164,040 USD | -157,530 |
| EUR/USD | 4 hours | n/a | 628 | 39.33 | 63,611 USD | -32,271 |
| Nikkei 225 | Daily | n/a | 185 | 41.08 | 39,525 USD | -11,465 |
| Nasdaq 100 | Daily | n/a | 182 | 40.11 | 14,484 EUR | -3,855 |
| Dow Jones | Daily | n/a | 196 | 41.84 | 11,940 EUR | -11,349 |
| Dow Jones | 4 hours | n/a | 139 | 40.29 | 10,043 EUR | -5,359 |
| GBP/USD | Daily | n/a | 213 | 42.25 | 9,593 USD | -8,749 |
| US Crude Oil | 1 hour | n/a | 1,236 | 38.35 | 8,586 EUR | -4,960 |
| GBP/USD | 1 hour | n/a | 2,199 | 38.74 | 5,734 USD | -5,250 |
| Brent Crude | 1 hour | n/a | 907 | 38.92 | 5,500 EUR | -5,165 |
| Gold | 30 min | n/a | 2,597 | 35.81 | 2,934 EUR | -933 |
| Gold | Daily | n/a | 199 | 47.74 | 2,560 EUR | -850 |
| Gold | 1 hour | n/a | 1,525 | 38.43 | 1,874 EUR | -903 |
| S&P 500 | Daily | n/a | 240 | 39.58 | 1,873 EUR | -861 |
| Gold | 5 min | n/a | 2,695 | 34.03 | 1,736 EUR | -558 |
| Gold | 10 min | n/a | 2,656 | 34.26 | 1,055 EUR | -879 |
| Gold | 2 min | n/a | 2,557 | 33.20 | 1,007 EUR | -616 |
Charts
Top 10 of 22 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Supertrend Flip With SMA Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE up = 0 ONCE dn = 0 ONCE trend = 1 myAtr = AverageTrueRange[10](close) upraw = MedianPrice - 3.0 * myAtr dnraw = MedianPrice + 3.0 * myAtr upone = up dnone = dn IF BarIndex = 0 THEN upone = upraw dnone = dnraw ENDIF
38 more lines: the entry and exit rules.
Setup
Gold had no history beyond the standard run, so both runs used 30,000 bars.
| Bars available | 30,000 |
| Net, standard 200,000-bar run | 3,584.30 EUR |
| Net, long run | 3,599.80 EUR |
| Net on the older data alone | 15.50 EUR |
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 22 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 1.77 over 422 trades.
The best run had a maximum drawdown of 452 EUR at the tested position size, against a net result of 3,584 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.