It buys when SMA(10) crosses above SMA(20) and sells short when it crosses below, reversing the position each time. Each trade carries a 10 percent trailing stop that only moves in its favor.
Best run of 6. Silver, 4 hours, spread 2, from run pf:2026-10-12-SILVER-4h.tsv:8.
| Period | Up to 2026-10-12 |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| SilverBest run | 4 hours | 3.58 | 1,730 | 35.32 | 602,063 USD | -18,973 |
| USD/JPY | Daily | 1.63 | 705 | 44.40 | 4,419,510 USD | -373,520 |
| USD/JPY | 1 hour | n/a | 7,720 | 37.31 | 1,273,050 USD | -572,180 |
| EUR/USD | Daily | n/a | 701 | 39.37 | 111,222 USD | -80,242 |
| Gold | Daily | n/a | 761 | 37.84 | 2,909 EUR | -880 |
| Gold | 1 hour | n/a | 6,804 | 34.27 | 2,345 EUR | -1,574 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // SMA Crossover With Trailing Stop // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false fast = Average[10](close) slow = Average[20](close)
11 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 6 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 3.58 over 1,730 trades.
The best run had a maximum drawdown of 18,973 USD at the tested position size, against a net result of 602,063 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.