Buys when the previous bar's range is the narrowest of the last 7 bars and the close then rises above the prior bar's high. The position is closed once 5 or more bars have passed since entry.
Best run of 2. USD/JPY, Daily, spread 1.4, from run pf:2026-10-10-USDJPY-D.tsv:21.
| Period | Up to 2026-10-10 |
| Instrument | USD/JPY, Daily |
| Spread | 1.4 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 | Daily | 1.60 | 59 | 61.02 | 1,769 USD | -662 |
| Brent Crude | Daily | 1.35 | 213 | 57.28 | 10,521 EUR | -3,367 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Narrow Range 7 Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE capital = 10000
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 2 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.60 over 59 trades.
The best run had a maximum drawdown of 662 USD at the tested position size, against a net result of 1,769 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.