This idea goes long when the 20-period exponential moving average crosses above the 50-period one, and goes short on the opposite cross. Each trade has a fixed stop 0.385% from entry and a target 0.577% away.
Best run of 2. USD/JPY, 30 min, spread 1, from run sweeps:2026-10-10-USDJPY-30m-opt.tsv:6.
| Period | Up to 2026-10-10 |
| Instrument | USD/JPY, 30 minutes |
| 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-10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 30 min | n/a | 3,661 | 32.15 | 412,760 USD | -152,440 |
| USD/JPY | 1 hour | n/a | 2,679 | 36.10 | 312,900 USD | -192,600 |
Charts
The code
// ============================================================== // EMA Crossover With Fixed Percent Bracket // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false shortma = ExponentialAverage[20](close) longma = ExponentialAverage[50](close)
16 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 2 market and timeframe combinations. The best run by trade count was USD/JPY, 30 minutes, with 3,661 trades.
The best run had a maximum drawdown of 152,440 USD at the tested position size, against a net result of 412,760 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.