Alternates buy and sell signals on the 9 period SMA. A buy comes when the close sits just above the average, within 1.009 times it, and a sell when the close is below the average and above 0.001 times it.
Best run of 14. USD/JPY, 4 hours, spread 1, from run sweeps:2026-10-04-USDJPY-4h-opt.tsv:31.
| Period | Up to 2026-10-04 |
| Instrument | USD/JPY, 4 hours |
| 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 | 4 hours | n/a | 2,552 | 34.01 | 741,300 USD | -239,660 |
| USD/JPY | Daily | n/a | 957 | 32.81 | 915,780 USD | -469,450 |
| EUR/USD | Daily | n/a | 909 | 32.01 | 46,468 USD | -38,920 |
| Nikkei 225 | Daily | n/a | 693 | 32.32 | 20,861 USD | -13,128 |
| Dow Jones | Daily | n/a | 932 | 34.12 | 15,680 EUR | -5,741 |
| DAX 40 | 4 hours | n/a | 2,164 | 33.73 | 9,669 EUR | -3,098 |
| Brent Crude | Daily | n/a | 270 | 37.41 | 7,525 EUR | -4,294 |
| Nasdaq 100 | 4 hours | n/a | 2,164 | 34.33 | 7,265 EUR | -4,431 |
| Nasdaq 100 | Daily | n/a | 685 | 31.68 | 6,824 EUR | -3,368 |
| Brent Crude | 4 hours | n/a | 1,162 | 32.96 | 6,459 EUR | -3,285 |
| DAX 40 | Daily | n/a | 955 | 33.82 | 5,492 EUR | -4,978 |
| Gold | Daily | n/a | 895 | 30.73 | 2,550 EUR | -1,241 |
| S&P 500 | Daily | n/a | 982 | 32.18 | 2,205 EUR | -1,334 |
| Gold | 4 hours | n/a | 2,255 | 31.44 | 2,059 EUR | -996 |
Charts
Top 10 of 14 runs. The full list is in the table above.
The code
// ============================================================== // SMA Band Toggle Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE prev = 1 sma = Average[9](close) myOver = sma * 1.009 myUnder = sma * 0.001
24 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 14 market and timeframe combinations. The best run by trade count was USD/JPY, 4 hours, with 2,552 trades.
The best run had a maximum drawdown of 239,660 USD at the tested position size, against a net result of 741,300 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.