Join waitlist
Strategies / Breakout / Alternating Donchian Breakout With EMA Filter

Alternating Donchian Breakout With EMA Filter

The system tracks whether price has touched the 20-bar lower or upper band since the last open position. It buys after a prior lower-band touch when price reaches the upper band and closes above the 200-period EMA, and sells short in the mirror case.

BreakoutLong & shortSwingS&P 500Daily
2.15Profit factor
5,322Net profit EUR
48.06%Win rate
129Trades
-1,253Max drawdown
41.26Avg trade

Best run of 17. S&P 500, Daily, spread 1, from run pf:2026-10-12-USA500-D.tsv:22.

Entry rules, long

  1. The low has touched the 20-bar lowest low at least once since the last position was held.
  2. The close is above the 200-period exponential moving average.

Entry rules, short

  1. The high has touched the 20-bar highest high at least once since the last position was held.
  2. The close is below the 200-period exponential moving average.

Exit rules

  1. The short stop is placed at the 20-bar highest high multiplied by 1.005, with a profit target derived from 1.5 times the risk.

Test conditions

PeriodUp to 2026-10-12
InstrumentS&P 500, 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
S&P 500Best runDaily2.15 12948.065,322 EUR-1,253
USD/JPYDaily1.27 2,53344.97250,480 USD-19,280
Silver3 minn/a 75542.7843,206 USD-12,404
Nikkei 225Dailyn/a 8355.4238,841 USD-12,192
Nasdaq 1004 hoursn/a 24942.9710,152 EUR-6,342
FTSE 100Dailyn/a 8952.818,398 EUR-2,958
US Crude Oil5 minn/a 78440.056,492 EUR-4,211
Nasdaq 1003 minn/a 40542.726,302 EUR-4,759
DAX 401 minn/a 15348.375,223 EUR-2,319
Nasdaq 1005 minn/a 53140.304,486 EUR-3,328
Nasdaq 1002 minn/a 28343.464,165 EUR-3,998
Gold3 minn/a 51943.352,946 EUR-784
Gold1 hourn/a 73342.842,290 EUR-904
Gold5 minn/a 55143.012,095 EUR-1,063
Gold30 minn/a 98741.031,902 EUR-1,064
S&P 5003 minn/a 25341.901,305 EUR-1,276
Gold4 hoursn/a 18943.921,049 EUR-821

Charts

Results by run

Top 10 of 17 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Alternating Donchian Breakout With EMA Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE prevhigh = 0
ONCE prevlow = 0

upper = highest[20](high)
lower = lowest[20](low)
ema = ExponentialAverage[200](close)

31 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 ChannelEMA
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 Alternating Donchian Breakout With EMA Filter 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 17 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 2.15 over 129 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,253 EUR at the tested position size, against a net result of 5,322 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

Trend Filtered Breakout Long

Also a breakout strategy.

2.14 PF · 99 trades

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

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