The strategy buys when the close rises above the highest close of the prior 50 bars and sells short when it falls below the lowest. Positions close when the close moves to the opposite side of the prior 50-bar average close.
Best run of 3. USD/JPY, Daily, spread 1, from run sweeps:2026-10-07-USDJPY-D-opt.tsv:14.
| Period | Up to 2026-10-07 |
| 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-07 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | n/a | 1,421 | 49.05 | 611,300 USD | -217,550 |
| GBP/USD | Daily | n/a | 1,407 | 49.89 | 8,687 USD | -3,611 |
| Brent Crude | Daily | n/a | 587 | 49.06 | 3,282 EUR | -3,208 |
Charts
The code
// ============================================================== // Fifty Bar Channel Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false myHigh = Highest[50](close) myLow = Lowest[50](close) avg = Average[50](close)
15 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 3 market and timeframe combinations. The best run by trade count was USD/JPY, Daily, with 1,421 trades.
The best run had a maximum drawdown of 217,550 USD at the tested position size, against a net result of 611,300 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.