Join waitlist
Strategies / Breakout / Pivot Breakout With ATR Stops

Pivot Breakout With ATR Stops

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.

BreakoutLong & shortSwingUSD/JPYDaily
2.78Profit factor
197,650Net profit USD
19.16%Win rate
1,164Trades
-22,400Max drawdown
170Avg trade

Best run of 6. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:13.

Entry rules, long

  1. A pivot high is a high above the 3 bars before it and at least as high as the 3 bars after it.
  2. Pivots are confirmed 3 bars late.
  3. Signals are only checked after 20 bars.

Entry rules, short

  1. A pivot low is a low below the 3 bars before it and at or below the 3 bars after it.
  2. Pivots are confirmed 3 bars late.
  3. Signals are only checked after 20 bars.

Exit rules

  1. An opposite signal closes the trade and reverses it.

Test conditions

PeriodUp to 2026-10-10
InstrumentUSD/JPY, Daily
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily2.78 1,16419.16197,650 USD-22,400
Nikkei 225Dailyn/a 64423.4529,634 USD-17,742
Brent CrudeDailyn/a 28225.1810,734 EUR-8,010
Nasdaq 100Dailyn/a 66417.328,249 EUR-6,905
GoldDailyn/a 76320.181,670 EUR-658
Gold4 hoursn/a 1,70121.341,518 EUR-795

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

ATR
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run197,650.00 USD
Net, long run197,650.00 USD
Net on the older data alone0.00 USD
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Pivot Breakout With ATR Stops in ProOrder?

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.

Which markets was it tested on?

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.

How large was the drawdown?

The best run had a maximum drawdown of 22,400 USD at the tested position size, against a net result of 197,650 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

KDJ J Line Momentum Long

Uses the same indicator.

4.17 PF · 6,135 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

Fifty Bar Fibonacci Level Cross

Also a breakout strategy.

2.64 PF · 3,012 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs