Donchian Trend EA:
The Ultimate Macro Breakout Bot
Catch the big moves. Ride the macro trends. Let the math manage the risk.
Introducing Donchian Trend EA, a robust, fully automated Expert Advisor that brings the legendary Donchian Channel breakout strategy into the modern algorithmic era. Designed for higher timeframes, this bot is built to capture massive, sustained market trends while strictly protecting your capital from choppy, ranging markets.
By combining classic price-action breakouts with a 200 EMA trend filter, dynamic ATR-based stops, and an intelligent dual-trailing exit system, this bot ensures you are always trading in the direction of the dominant momentum.
The Core Strategy: How It Works
The Donchian Trend EA operates on a "closed bar only" evaluation system, ensuring it ignores intraday noise and focuses purely on confirmed structural breakouts.
- The Donchian Breakout: The bot calculates the highest high and lowest low over a configurable lookback period (default: 55 bars). A buy signal is generated when the price closes above the 55-period high, and a sell signal triggers when it closes below the 55-period low.
- The 200 EMA Trend Filter: To prevent false breakouts in ranging markets, the bot applies a 200-period Exponential Moving Average. It will only execute buy breakouts if the price is above the 200 EMA, and sell breakouts if the price is below it.
- One Trade at a Time: The bot maintains strict focus, allowing only one active position per account to ensure precise risk management and clear trade tracking.
Advanced Trade Management & Dynamic Exits
Knowing when to exit is just as important as knowing when to enter. Donchian Trend EA features a sophisticated, multi-layered exit strategy designed to let winners run while cutting losers quickly:
- ATR-Based Initial Stop: The initial stop loss is placed dynamically based on the Average True Range (default: 2.5x ATR), giving the trade enough room to breathe without risking excessive capital.
- Dual Trailing Exit System: Once in profit, the bot trails the stop loss using two methods simultaneously:
- Donchian Exit Channel: Trails the stop behind the lowest low of the last 20 bars (for buys) or highest high (for sells).
- ATR Trailing Stop: Trails the stop at a fixed distance of 3.0x ATR from the current price.
- Automatic Reversal Logic: If the bot is in a buy position and a valid sell breakout occurs, it will automatically close the losing trade and instantly reverse into a new sell position, ensuring you are always aligned with the new trend.
Institutional Risk Control
Capital preservation is hardcoded into the bot's logic:
- Dynamic Position Sizing: Risks a strict percentage of your account balance per trade (default: 1.0%). The lot size is automatically calculated based on the exact distance to the ATR stop loss.
- Max Drawdown Circuit Breaker: If the account equity drops by a specified percentage from its peak (default: 30%), the bot will immediately halt all new trade entries until the account is reset or manually restarted.
- Spread Protection: Includes a configurable maximum spread filter to prevent entries during illiquid hours or sudden broker spread widening.
Disclaimer
Trading foreign exchange and commodities (especially Gold/XAUUSD) on margin carries a high level of risk and may not be suitable for all investors. Past performance of the EA or backtested results does not guarantee future results. The high degree of leverage can work against you as well as for you. Before deciding to trade, you should carefully consider your investment objectives, level of experience, and risk appetite. There is a possibility that you may sustain a loss of some or all of your initial investment.
Results
Click on the pictures to enlarge.
Version - 3929
Version - 4353
Version - 16430
Version curated
Version 5984
Version - 5871
Version 5883
Add comment
Comments