Donchain counter
This EA implements a Donchian Channel breakout counter strategy, entering trades when price breaks above or below the Donchian Channel high/low boundaries. It counts consecutive breakout bars and uses that count to determine entry timing and position management. The strategy is a classic trend-following breakout system based on the Donchian Channel indicator.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is based on Donchian Channel breakouts, where the channel is formed by the highest high and lowest low over a specified period, going long when price breaks above the upper band and short when it breaks below the lower band. Entry conditions require price to breach the Donchian Channel boundaries, with a breakout counter used to confirm the validity of the breakout and filter out false signals. Exit conditions include hitting stop loss or take profit levels, as well as reverse breakout signals from the channel. Position sizing uses either fixed lots or dynamic lot calculation based on account equity. Money management relies on stop loss to control per-trade risk, but lacks an explicit maximum risk percentage per trade limit. The overall strategy logic is simple and clear, functioning as a variant of the classic Turtle Trading system that depends on trend persistence for profitability.
Strengths
- Strategy logic is simple and clear, based on the classic Donchian Channel breakout principle, easy to understand and maintain
- Breakout counter filters false breakouts, improving entry signal reliability
- Trend-following strategy performs excellently in strong trending markets, capable of capturing major moves
- Highly configurable parameters allow traders to adjust channel period and breakout thresholds for different market conditions
Weaknesses
- Prone to frequent false breakout signals in ranging markets, leading to consecutive losses
- Lacks dynamic correlation between position sizing and account risk, fixed lots may pose excessive risk in extreme conditions
- No trailing stop mechanism included, potentially giving back significant profits during retracements
- Breakout counter logic lags in fast reversal markets, potentially missing optimal exit timing
Possible improvements
- Add trailing stop functionality to lock in more profits during trend continuation
- Implement ATR-based dynamic stop loss and position sizing for adaptive risk adjustment based on market volatility
- Add a ranging market filter (such as ADX or volatility indicator) to reduce trade frequency during low trend strength periods
Risk assessment
Overall risk: Medium
- Fixed lot sizing is not tied to account risk ratio, potentially causing excessive per-trade risk on small accounts
- Lacks ranging market filter, which may produce consecutive losses in sideways markets
- Stop loss settings may be insufficient for extreme events like price gaps
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
DonchainPeriod | 20 | Donchian channel calculation period |
StopLoss | 500 | Stop loss in points |
TakeProfit | 1000 | Take profit in points |
LotSize | 0.1 | Fixed trading lot size |
MagicNumber | 12345 | Manage positions with specific magic number only; 0 manages all |
BreakoutCount | 2 | Consecutive candles required to confirm breakout |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.