The strategy buys when price closes above a 40-period average of highs, and sells short when it closes below a 40-period average of lows. Each trade has a stop at the opposite band and a target 3 times the stop distance away.
Best run of 5. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:70.
| Period | Up to 2026-10-11 |
| Instrument | USD/JPY, 1 hour |
| 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-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 1 hour | n/a | 6,525 | 29.66 | 391,170 USD | -262,820 |
| EUR/USD | Daily | n/a | 607 | 30.97 | 120,622 USD | -60,227 |
| Nasdaq 100 | Daily | n/a | 590 | 30.34 | 9,004 EUR | -5,832 |
| Gold | 4 hours | n/a | 1,436 | 33.84 | 2,477 EUR | -697 |
| Gold | Daily | n/a | 692 | 31.50 | 1,071 EUR | -1,000 |
Charts
The code
// ============================================================== // Moving Average Band Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false ONCE lsl = 0 ONCE ltp = 0 ONCE ssl = 0 ONCE stp = 0 upper = Average[40](high) lower = Average[40](low)
26 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 5 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 6,525 trades.
The best run had a maximum drawdown of 262,820 USD at the tested position size, against a net result of 391,170 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.