Join waitlist
Strategies / Breakout / Donchian Channel Midline Exit

Donchian Channel Midline Exit

The system buys when the close exceeds the prior 10-bar high and sells short when it falls below the prior 10-bar low. Positions close when price crosses back through the midpoint of the 10-bar channel.

BreakoutLong & shortSwingUSD/JPYDaily
1.33Profit factor
2,367,080Net profit USD
37.77%Win rate
842Trades
-543,910Max drawdown
2,811Avg trade

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

Entry rules, long

  1. The close is above the highest high of the previous 10 bars.

Entry rules, short

  1. The close is below the lowest low of the previous 10 bars.

Exit rules

  1. The short closes when the close rises above the midpoint of the 10-bar high and low range.

Test conditions

PeriodUp to 2026-10-12
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.33 84237.772,367,080 USD-543,910
Brent CrudeDailyn/a 34241.5212,582 EUR-10,056
GBP/USDDailyn/a 91640.2811,432 USD-8,804
Gold4 hoursn/a 1,93738.511,165 EUR-1,008

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Donchian Channel Midline Exit
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

hh = highest[10](high)
ll = lowest[10](low)
base = (hh + ll) / 2

21 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

Donchian Channel
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Donchian Channel Midline Exit 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 4 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.33 over 842 trades.

How large was the drawdown?

The best run had a maximum drawdown of 543,910 USD at the tested position size, against a net result of 2,367,080 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Turtle Trade

Uses the same indicator.

2.42 PF · 6,324 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

Volatility Band Downside Breakout

Also a breakout strategy.

1.33 PF · 174 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

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