MA_Crossover_ADX
This EA uses the MQL5 Standard Library Expert framework to implement a trend-following strategy based on MA crossover confirmed by ADX strength. It enters trades when a moving average crossover occurs and the ADX value exceeds a minimum threshold, with fixed lot sizing and no trailing stop.
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 | +4.09% | +3.54% | 3.91% | 101 | 51.00% | 0.96 | 1.05 | 6 | +$4.43 | Reliable |
| GBPUSD | -1.29% | -1.12% | 6.21% | 101 | 50.50% | -0.19 | -0.21 | 5 | −$1.28 | Reliable |
| USDJPY | -1.98% | -1.72% | 5.01% | 131 | 42.30% | -0.42 | -0.40 | 7 | −$1.53 | Reliable |
| XAUUSD | +19.19% | +15.61% | 42.94% | 100 | 51.50% | 0.58 | 0.45 | 7 | +$21.88 | Reliable |
Profitable on 2 of 4 markets with reliable results.
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.
Against the other Trend Following EAs with a reliable result on the same market: EURUSD: better than 82% of 95 · GBPUSD: better than 36% of 95 · USDJPY: better than 32% of 95 · XAUUSD: better than 66% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 62% | +2.26% 2026-03 | -1.53% 2026-10 |
| GBPUSD | 54% | +1.69% 2026-06 | -2.91% 2026-10 |
| USDJPY | 62% | +2.30% 2026-09 | -3.09% 2026-08 |
| XAUUSD | 69% | +16.91% 2026-02 | -26.75% 2026-08 |
From the backtest equity curve, sampled about every two days; only reliable results.
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 a trend-following system combining moving average crossover signals with ADX trend strength filtration. Entry conditions require a moving average crossover to occur and the ADX indicator value must exceed a configurable minimum threshold (default 22.0), ensuring trades are only opened when the trend is sufficiently strong. Exit conditions rely on fixed stop loss (400 points) and take profit (900 points) levels, with a reward-to-risk ratio of 2.25:1, reflecting a solid profit factor design. Position sizing uses a fixed lot mode (default 0.1 lots) that does not dynamically adjust based on account balance or equity. Money management employs the CMoneyFixedLot class, which despite having a percentage parameter configured (10%), operates in fixed lot mode and lacks dynamic risk scaling. The strategy does not use any trailing stop (TrailingNone), meaning it cannot lock in floating profits during trending moves and risks significant profit givebacks.
Strengths
- MA crossover combined with ADX filtration effectively reduces false signals in ranging markets
- Stop loss to take profit ratio of 2.25:1 is well-designed for long-term positive expectancy
- Built on MQL5 Standard Library Expert framework with clean and standardized code structure
- Configurable ADX minimum threshold parameter allows adaptation to different market volatility environments
Weaknesses
- No trailing stop mechanism means profits cannot be locked in during trend reversals
- Fixed lot position sizing cannot dynamically adjust risk exposure based on account size
- Lacks new bar check mechanism (Expert_EveryTick=false partially mitigates but does not fully resolve), potential for repeated entries on the same bar
- Relies on single MA period crossover without multi-timeframe confirmation
- No spread filter mechanism, which may be detrimental in high-spread environments
Possible improvements
- Add a trailing stop module (e.g., TrailingFixedPct or TrailingStopPct) to lock in profits during trending moves
- Introduce multi-timeframe confirmation, such as entering on H1 signals only when aligned with H4 trend direction
- Replace fixed lot sizing with dynamic position management that auto-adjusts lot size based on ATR or account risk percentage
Risk assessment
Overall risk: Medium
- No trailing stop causes winning trades to potentially give back significant profits
- Fixed lot sizing does not adjust with account changes, causing risk ratio to passively increase after consecutive losses
- Lack of spread filter may result in unfavorable fills during high volatility or low liquidity periods
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Inp_Signal_ADX_MA_PeriodADX | 33 | ADX indicator period |
Inp_Signal_ADX_MA_MinimumADX | 22.0 | ADX minimum threshold; no entry below this value |
Inp_Signal_ADX_MA_PeriodMA | 39 | Moving average period |
Inp_Signal_ADX_MA_StopLoss | 400 | Stop loss in points |
Inp_Signal_ADX_MA_TakeProfit | 900 | Take profit in points |
Inp_Money_FixLot_Percent | 10.0 | Risk percentage for fixed lot money management |
Inp_Money_FixLot_Lots | 0.1 | Fixed trading lot size |
Expert_MagicNumber | 13072 | EA magic number for identifying its orders |
Expert_EveryTick | false | Execute trading logic on every tick |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.