Buys when close crosses above the last confirmed pivot high, and sells short when it crosses below the last pivot low. Each trade has a stop and target set at 1 and 9 times the 14-period ATR.
Best run of 6. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:13.
| Period | Up to 2026-10-10 |
| 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-10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 2.78 | 1,164 | 19.16 | 197,650 USD | -22,400 |
| Nikkei 225 | Daily | n/a | 644 | 23.45 | 29,634 USD | -17,742 |
| Brent Crude | Daily | n/a | 282 | 25.18 | 10,734 EUR | -8,010 |
| Nasdaq 100 | Daily | n/a | 664 | 17.32 | 8,249 EUR | -6,905 |
| Gold | Daily | n/a | 763 | 20.18 | 1,670 EUR | -658 |
| Gold | 4 hours | n/a | 1,701 | 21.34 | 1,518 EUR | -795 |
Charts
The code
// ============================================================== // Pivot Breakout With ATR Stops // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE lasthigh = 0 ONCE lastlow = 0
33 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 | 197,650.00 USD |
| Net, long run | 197,650.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 6 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 2.78 over 1,164 trades.
The best run had a maximum drawdown of 22,400 USD at the tested position size, against a net result of 197,650 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.