It buys when SMA(14) crosses above SMA(28) and sells short when it crosses below, so the position reverses on each signal. The strategy has no stop loss or profit target.
Best run of 11. USD/JPY, Daily, spread 1, from run pf:2026-10-04-USDJPY-D.tsv:21.
| Period | Up to 2026-10-04 |
| Instrument | USD/JPY, Daily |
| Spread | 1 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 |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.58 | 513 | 40.94 | 3,492,750 USD | -497,760 |
| USD/JPY | 1 hour | 1.13 | 5,440 | 38.53 | 1,428,190 USD | -326,420 |
| USD/JPY | 30 min | n/a | 7,784 | 36.23 | 611,960 USD | -254,490 |
| EUR/USD | Daily | n/a | 485 | 43.51 | 154,300 USD | -62,071 |
| Brent Crude | Daily | n/a | 183 | 38.25 | 22,902 EUR | -10,399 |
| US Crude Oil | Daily | n/a | 426 | 40.61 | 21,155 EUR | -10,333 |
| Nasdaq 100 | Daily | n/a | 400 | 39.25 | 13,627 EUR | -5,355 |
| DAX 40 | 1 hour | n/a | 4,323 | 38.35 | 11,106 EUR | -8,718 |
| Gold | 1 hour | n/a | 4,742 | 35.91 | 3,823 EUR | -1,659 |
| Gold | 4 hours | n/a | 1,238 | 36.83 | 1,712 EUR | -1,342 |
| Gold | Daily | n/a | 559 | 39.53 | 1,549 EUR | -1,321 |
Charts
Top 10 of 11 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // SMA Crossover Stop And Reverse // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false smafast = Average[14](close) smaslow = Average[28](close)
13 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 11 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.58 over 513 trades.
The best run had a maximum drawdown of 497,760 USD at the tested position size, against a net result of 3,492,750 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.