The strategy buys when the 50-period EMA is above the 200-period EMA, RSI(14) is above 55, and the close crosses above the last confirmed swing high. It sells short on the mirror setup.
Best run of 9. Silver, 4 hours, spread 2, from run pf:2026-10-04-SILVER-4h.tsv:6.
| Period | Up to 2026-10-04 |
| Instrument | Silver, 4 hours |
| Spread | 2 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 |
|---|---|---|---|---|---|---|
| SilverBest run | 4 hours | 3.95 | 841 | 26.16 | 237,807 USD | -11,337 |
| Gold | 4 hours | 1.65 | 853 | 31.30 | 3,199 EUR | -279 |
| Nikkei 225 | Daily | n/a | 312 | 32.37 | 18,713 USD | -6,737 |
| Silver | Daily | n/a | 332 | 28.31 | 10,806 USD | -4,459 |
| US Crude Oil | Daily | n/a | 284 | 33.80 | 7,591 EUR | -5,158 |
| Brent Crude | Daily | n/a | 115 | 36.52 | 7,573 EUR | -3,103 |
| DAX 40 | 1 hour | n/a | 3,040 | 27.73 | 4,317 EUR | -2,717 |
| Gold | Daily | n/a | 389 | 31.62 | 1,226 EUR | -660 |
| S&P 500 | Daily | n/a | 482 | 25.52 | 882 EUR | -671 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Swing Break With EMA and RSI // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE lasthigh = 0 ONCE hashigh = 0 ONCE lastlow = 0 ONCE haslow = 0 emafast = ExponentialAverage[50](close) emaslow = ExponentialAverage[200](close) myRsi = RSI[14](close) myAtr = AverageTrueRange[14](close)
44 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,199.20 EUR |
| Net, long run | 3,202.50 EUR |
| Net on the older data alone | 3.30 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 9 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 3.95 over 841 trades.
The best run had a maximum drawdown of 11,337 USD at the tested position size, against a net result of 237,807 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.