Buys when the close crosses above a zero-lag line plus 2 ATR while it rises, and sells short when the close crosses below the line minus 2 ATR while it falls. Trades exit on a cross back through the line, with 2 ATR stops and 4 ATR targets.
Best run of 2. USD/JPY, Daily, spread 1, from run pf:2026-10-05-USDJPY-D.tsv:13.
| Period | Up to 2026-10-05 |
| 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.45 | 349 | 41.26 | 24,260 USD | -4,850 |
| Gold | Daily | n/a | 273 | 42.12 | 711 EUR | -516 |
Charts
The code
// ============================================================== // Zero Lag ATR Band Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false emaa = ExponentialAverage[20](close) emab = ExponentialAverage[20](emaa) zl = 2 * emaa - emab myAtr = AverageTrueRange[14](close) upper = zl + myAtr * 2.0 lower = zl - myAtr * 2.0
24 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 | 24,260.00 USD |
| Net, long run | 24,260.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 2 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.45 over 349 trades.
The best run had a maximum drawdown of 4,850 USD at the tested position size, against a net result of 24,260 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.