The idea buys when RSI(14) breaks above its prior 20-bar high after its range has compressed, with EMA(50) above its value 5 bars earlier and ADX(14) at or above 15. It sells short on the mirror-image break below its 20-bar low.
Best run of 4. USD/JPY, Daily, spread 1, from run pf:2026-10-04-USDJPY-D.tsv:2.
| Period | Up to 2026-10-04 |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 4.80 | 257 | 20.23 | 172,490 USD | -35,550 |
| Silver | 4 hours | n/a | 393 | 36.90 | 11,438 USD | -7,196 |
| FTSE 100 | Daily | n/a | 1 | 100.00 | 9,254 EUR | -3,643 |
| DAX 40 | 4 hours | n/a | 360 | 33.33 | 5,436 EUR | -2,588 |
Charts
The code
// ============================================================== // RSI Range Compression Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE bss = 100000 myRsi = RSI[14](close) rsihigh = highest[20](myRsi) rsilow = lowest[20](myRsi) rsirange = rsihigh - rsilow ema = ExponentialAverage[50](close)
40 more lines: the entry and exit rules.
Setup
USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.
| Bars available | 12,000 |
| Net, standard 200,000-bar run | 172,490.00 USD |
| Net, long run | 172,490.00 USD |
| Net on the older data alone | 0.00 USD |
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 4 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 4.80 over 257 trades.
The best run had a maximum drawdown of 35,550 USD at the tested position size, against a net result of 172,490 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.