A two-bar breakout system that goes long when price breaks above the higher of the two prior highs while close is above a 50-period EMA, and short on the mirror condition. An opposite signal reverses the position, and trades also close when price breaks the opposite two-bar extreme.
Best run of 1. USD/JPY, Daily, spread 1, from run sweeps:2026-10-03-USDJPY-D-opt.tsv:63.
| Period | Up to 2026-10-03 |
| 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-03 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | n/a | 2,067 | 39.04 | 2,220,290 USD | -623,950 |
Charts
The code
// ============================================================== // Two Bar Breakout EMA Trend // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ema = ExponentialAverage[50](close)
21 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 one combination, USD/JPY, Daily, with 2,067 trades.
The best run had a maximum drawdown of 623,950 USD at the tested position size, against a net result of 2,220,290 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.