Join waitlist
Strategies / Breakout / 20 Day Breakout Long Short

20 Day Breakout Long Short

It buys on a break above the highest high of the previous 20 bars and sells short on a break below the lowest low of the previous 20 bars. Longs close below the 10 bar low and shorts close above the 10 bar high.

BreakoutLong & shortSwingBrent CrudeDaily
1.47Profit factor
22,242Net profit EUR
40.38%Win rate
156Trades
-11,697Max drawdown
143Avg trade

Best run of 2. Brent Crude, Daily, spread 5, from run pf:2026-10-11-BRENT-D.tsv:8.

Entry rules, long

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

Entry rules, short

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

Exit rules

  1. The close rises above the highest high of the previous 10 bars, closing the short.

Test conditions

PeriodUp to 2026-10-11
InstrumentBrent Crude, Daily
Spread5 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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Brent CrudeBest runDaily1.47 15640.3822,242 EUR-11,697
EUR/USDDaily1.28 37842.869,318 USD-4,354

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// 20 Day Breakout Long Short
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false
ONCE capital = 10000

24 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 maximum drawdown of 11,697 EUR is large next to the net profit of 22,242 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run 20 Day Breakout Long Short 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 2 market and timeframe combinations. The best run was Brent Crude, Daily, with a profit factor of 1.47 over 156 trades.

How large was the drawdown?

The best run had a maximum drawdown of 11,697 EUR at the tested position size, against a net result of 22,242 EUR.

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

Hull Trend With ADX Filter

Best run on the same market, Brent Crude.

1.27 PF · 1,400 trades

Pivot Trendline Breakout (long and short)

Also a breakout strategy.

1.48 PF · 1,461 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