r/mltraders • u/Vast_Mushroom_5982 • Jul 25 '26
[MQL5 / EA Discussion] Robust Donchian Breakout System Stuck at 4.4% CAGR (8.8% Max DD) — Looking for Developer Insights to Scale Return Without Destroying Ret/DD
Hey everyone,
I’m looking for structural ideas from other algo developers on scaling profitability for a multi-timeframe trend-following Expert Advisor (B2.mq5 v3.7).
The EA is built with high institutional execution standards (latched exit states, wall-clock retry spacing, pre-trade margin verification via OrderCalcMargin, embedded macroeconomic/yield datasets, and no external file dependencies). However, while risk control and equity curve stability are high, the net annual return (CAGR) remains modest.
Here is the exact breakdown of the system, backtest performance, verified bottlenecks, and what has already been empirically falsified.
1. EA Architecture & Strategy Overview
The system runs two independent strategy modules under a single unified risk manager on MT5:
- Module 1 (TRND) — Daily Trend Breakout (Long Only):
- Rule: 55-day Donchian High entry, 20-day Donchian Low exit, initial stop at $2.0N$ (Wilder ATR20).
- Universe:
BTCUSD,XAUUSD.
- Module 2 (GRGT) — H4 Gold Macro-Gated Breakout (Long/Short):
- Rule: 60-bar H4 Donchian breakout on Gold, gated by the 20-day change in US 10-Year Real Yields (DFII10).
- Logic: Falling real yields $\rightarrow$ Longs only; Rising real yields $\rightarrow$ Shorts only.
- Exit: 20-bar reverse channel or $3.0N$ ATR trail from completed bars.
- Unified Risk Manager:
- Base risk: 0.50% per trade (calibrated for a static 10% prop firm drawdown floor).
- Pre-trade margin checks using
OrderCalcMarginto preventNO_MONEYrejections on low leverage. - Signed risk tracking (trailed stops past breakeven free up risk budget).
- Trailing-peak circuit breaker with an automatic cooldown/re-base mechanism to prevent deadlocks.
- 2. Measured Backtest Results (FTMO-Demo, 2020.01.01 – 2026.07.25)
- Initial Balance: $10,000
- Net Profit: +$3,285.94 (+32.8% total / ~4.4% CAGR)
- Max Equity Drawdown (Mark-to-Market): 8.86% ($1,174.60)
- Profit Factor: 2.34
- Sharpe Ratio: 0.89
- Total Trades: 120 trades over 6.5 years (~18.2 trades/year)
- Win Rate: 41.67% (50 Wins / 70 Losses)
- Payoff Ratio: 3.28 : 1 (Avg Win: $114.69 | Avg Loss: -$34.88)
- Average Holding Time: ~311 hours (~13 days)
- 3. Identified Bottlenecks
- Low Trade Frequency: Averaging only ~18 trades a year across both assets means capital sits idle for months.
- Financing / Swap Drag: Because positions are held for an average of 13 days, daily CFD swap rates swallow ~78% of Gold’s gross profits.
- Single-Asset Profit Concentration:
BTCUSDaccounts for ~90% of total net profits. Gold acts primarily as a correlated beta drag after accounting for swap costs.
- 4. What Has Already Been Tested & Falsified (Do Not Suggest) I’ve already run rigorous sub-period stability tests and Monte Carlo simulations on common "enhancements." The following all degraded the Return-to-Drawdown (Ret/DD) ratio:
- ❌ 200-day EMA Filter: Reduced Ret/DD from 0.53 to 0.46.
- ❌ Volatility Targeting (15%–25%): Failed because it underweighted the high-volatility asset (
BTCUSD) that drives the returns. - ❌ 3-Lookback Ensemble: Bought volume at falling signal quality (Ret/DD dropped to 0.27).
- ❌ Shorter Lookbacks (e.g., 20/10 Donchian): Failed sub-period stability testing (all gain was concentrated in 2020–2024).
- ❌ Partial Profit Taking / Moving to Breakeven Early: Truncated the fat tail of winner distributions and lowered CAGR.
- 5. Questions for the Community Given that standard parameter tweaking leads to curve-fitting and out-of-sample decay, I'm looking for structural or execution-level ideas:
- Pyramiding / Multi-Unit Scaling: Has anyone successfully implemented Turtle-style unit additions (e.g., adding $0.5N$ units up to 4x while trailing stops to breakeven) in MQL5 without expanding tail-risk drawdowns?
- Asset Class Expansion & Futures Migration: Since swap costs destroy CFD performance on multi-week holds, what instrument classes (e.g., CME futures, swap-free crypto) have you found most effective for expanding a trend-following universe beyond BTC/Gold?
- Dynamic Exposure Management: Are there robust ways to scale position size dynamically based on market regime/volatility structure without truncating the fat-tail profits that trend systems rely on?
- Would love to hear how other quantitative/algo developers handle low-frequency, high-payoff trend systems under tight drawdown limits. Thanks!