Donchian Channel EA: no-code builder for MT4 / MT5
ChannelsThe Donchian Channel is the highest high and lowest low of the last N candles. Go long on a close above the upper band, short on a close below the lower. It's the breakout rule used by the Turtle Traders.
Rules you can build with it
Works as an entry rule or an exit rule. Short rules are mirrored automatically.
- LongPrevious candle closes above Upper channelShortPrevious candle closes below Lower channel
- LongPrevious candle closes below Lower channelShortPrevious candle closes above Upper channel
- LongCandle opens above Upper channelShortCandle opens below Lower channel
- LongCandle opens below Lower channelShortCandle opens above Upper channel
Settings
| Settings | Default | Range |
|---|---|---|
| Period | 20 | 5 – 200 |
How the backtest and the EA calculate it
MT5 has no built-in Donchian Channel, so the exported EA calculates it directly from the highest high and lowest low of the last N candles, exactly as in the backtest.
Signals use only closed candles and are filled at the next candle's open. The exported EA checks conditions in the same order, so you get similar results in the MT5 Strategy Tester.
Example strategies
- Entry · Donchian Channel (20): Previous candle closes above Upper channel
- Stop-loss 300 points, take-profit 600 points
- Entry · Donchian Channel (20): Previous candle closes above Upper channel
- Entry · Moving Average (50, EMA, Close): MA rises
- Stop-loss 300 points, take-profit 600 points
Examples are just a starting point: open one to change settings or add filters, then check it with backtests and robustness tests. Backtest results don't indicate future returns.