The strategy watches a 20-bar box while ADX(14) is below 18. It buys when the close crosses the box top, sells short on a cross of the bottom, and uses stops and targets sized to the box width.
Best run of 8. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:49.
| Period | Up to 2026-10-12 |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.44 | 491 | 38.29 | 24,870 USD | -3,100 |
| Silver | 4 hours | 1.42 | 334 | 39.52 | 17,986 USD | -3,564 |
| Dow Jones | Daily | n/a | 210 | 36.19 | 16,537 EUR | -5,566 |
| Nasdaq 100 | 4 hours | n/a | 324 | 36.42 | 7,248 EUR | -3,568 |
| Nasdaq 100 | Daily | n/a | 217 | 35.02 | 6,071 EUR | -4,086 |
| Brent Crude | Daily | n/a | 90 | 41.11 | 6,048 EUR | -2,967 |
| Brent Crude | 1 hour | n/a | 840 | 35.36 | 5,361 EUR | -3,446 |
| S&P 500 | Daily | n/a | 263 | 30.80 | 1,503 EUR | -583 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // ADX Filtered Box Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE boxup = 0 ONCE boxdn = 0 myAdx = ADX[14] IF NOT OnMarket THEN boxup = highest[20](high)[1] boxdn = lowest[20](low)[1] ENDIF width = boxup - boxdn
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 8 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.44 over 491 trades.
The best run had a maximum drawdown of 3,100 USD at the tested position size, against a net result of 24,870 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.