Join today
Strategies / Breakout / Range Breakout Pending

Range Breakout Pending: Stop Orders Above and Below the Range

While flat, the system places a buy stop 5 points above the 10-bar high and a sell stop 5 points below the 10-bar low. Orders last one bar and are renewed each bar. Trades take a 10 point profit or a 60 point loss.

BreakoutLong & shortSwingDow Jones4 hours
1.64Profit factor
2,867Net profit EUR
90.84%Win rate
808Trades
-310Max drawdown
3.55Avg trade

Best run of 6. Dow Jones, 4 hours, spread 3, from run pf:2026-09-15-DOW30-4h.tsv:2.

Entry rules, long

  1. No position is open and at least 10 bars have passed since the last trade
  2. Members only

Entry rules, short

  1. No position is open and at least 10 bars have passed since the last trade
  2. Members only

Exit rules

  1. Stop loss of 60 points
  2. Members only

Test conditions

PeriodUp to 2026-09-15
InstrumentDow Jones, 4 hours
Spread3 points
Contracts1
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-09-15

Parameters

positionSize
Contracts per trade
1
stopLossPoints
Protective stop in points
60
takeProfitPoints
Profit target in points
10
lookbackPeriod
Bars for the range high and low
10
entryOffsetPoints
Distance of the stop orders beyond the range, in points
5
warmupMultiplier
Bars to wait before trading, as a multiple of lookbackPeriod
2

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Dow JonesBest run4 hours1.64 80890.842,867 EUR-310
GBP/USDDaily1.63 1,02390.913,604 USD-310
USD/JPYDaily1.49 96989.99286,150 JPY-46,000
DAX 40Daily1.33 86789.041,933 EUR-381
EUR/USDDaily1.15 96287.3210,854 USD-5,993
USD/JPY4 hours1.14 2,31387.25251,420 JPY-66,380

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.00.51.01.52.01.0 = break-evenDow Jones · 4 hours1.64GBP/USD · Daily1.63USD/JPY · Daily1.49DAX 40 · Daily1.33EUR/USD · Daily1.15USD/JPY · 4 hours1.14

Net profit against max drawdown

Net profitMax drawdown
0-100K-50K250K500KUSD/JPY · DailyUSD/JPY · 4 hoursEUR/USD · DailyGBP/USD · DailyDow Jones · 4 hoursDAX 40 · Daily

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Range Breakout Pending
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 4 hours
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 1000

// --- Parameters ---
positionSize = 1          // contracts per trade
stopLossPoints = 60       // protective stop in points
takeProfitPoints = 10     // profit target in points
lookbackPeriod = 10       // bars for the highest high / lowest low
entryOffsetPoints = 5     // stop orders sit this many points beyond the range
warmupMultiplier = 2      // wait lookbackPeriod times this many bars before trading

// --- Indicators ---
channelHigh = Highest[lookbackPeriod](high)
channelLow = Lowest[lookbackPeriod](low)
warmedUp = BarIndex >= lookbackPeriod * warmupMultiplier
barsSinceTrade = BarIndex - TradeIndex(1)

13 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The target is tiny next to the stop (10 points against 60), so one loss wipes out six wins.
  • A high win rate (90.84% in the best run) hides the fact that the average trade is only 3.55 EUR.
  • Only 4 hour and Daily charts were tested, on 6 runs.
  • USD/JPY 4 hours made 251,420 JPY but had a 66,379.97 JPY drawdown.

Indicators used

Donchian Channel

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Does it work with ProOrder?

Yes. Pending stop orders are supported in ProOrder, and the code renews them every bar while flat.

How did it do on each market?

Dow Jones 4 hours made 2,867.40 EUR over 808 trades. GBP/USD Daily, USD/JPY Daily, DAX 40 Daily, EUR/USD Daily and USD/JPY 4 hours were also positive.

How much risk at 1 contract?

Every loss is capped at 60 points. With 1 contract and a 3 point spread, the Dow Jones 4 hour run had a max drawdown of 310 EUR.

Why 4 hour and Daily charts?

A 10 point target is small compared with the swing on slow bars, which is why the win rate is high there. On faster charts the spread would take a larger share.

Related

Strategies like this one

Turtle Trade

Uses the same indicator.

2.42 PF · 6,324 trades

Navigator

Best run on the same market, Dow Jones.

2.93 PF · 181 trades

Cumulative RSI Long and Short

A similar profit factor.

1.64 PF · 461 trades

See how members size tight target systems. Join the ProRealAlgos waitlist.

Copy trading on US indices is available to ProRealAlgos members as spots open.

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