MA.mq5
A dual moving average crossover EA that uses a fast 3-period LWMA and a slow 57-period EMA to generate trend-following signals. It enters buy positions when both MAs are rising and price closes above the slow MA, and sell positions when both MAs are falling and price closes below the slow MA, with fixed SL/TP and 5-digit broker adjustment.
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 | -39.84% | -35.70% | 43.46% | 29 | 41.40% | -1.79 | -0.92 | 4 | −$137.38 | Reliable |
| GBPUSD | -1.97% | -1.71% | 20.77% | 27 | 51.90% | 0.08 | -0.10 | 4 | −$7.28 | Reliable |
| USDJPY | -13.20% | -11.57% | 20.15% | 29 | 51.70% | -0.60 | -0.66 | 2 | −$45.50 | Reliable |
| XAUUSD | -100.00% | -100.00% | 100.00% | 2 | 0.00% | — | -1.00 | 2 | −$5,131.27 | Account stopped out |
Profitable on 0 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 0% of 95 · GBPUSD: better than 31% of 95 · USDJPY: better than 1% of 95 · XAUUSD: better than 0% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 15% | +2.03% 2026-09 | -8.56% 2026-01 |
| GBPUSD | 46% | +22.03% 2026-02 | -10.78% 2025-12 |
| USDJPY | 46% | +3.55% 2026-09 | -10.29% 2026-02 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Hit a stop-out in our backtest (equity below 10%) on XAUUSD
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
This EA employs a dual moving average trend-following strategy, using the directional consistency of a fast 3-period LWMA and a slow 57-period EMA along with price relative position to identify trends. Buy entry requires four conditions: the slow MA rising for 3 consecutive bars, the fast MA rising for 3 consecutive bars, the close price above the previous slow MA value, and the slow MA above the fast MA. Sell entry mirrors this with declining conditions. Exit relies entirely on fixed stop loss and take profit of 100 points each (auto-adjusted by 10x for 5-digit brokers). Position sizing is a fixed 1.0 lot with no dynamic sizing or money management logic. The strategy only executes on new bars to avoid redundant signals, and it restricts to one position at a time per direction.
Strengths
- New bar detection prevents redundant trade entries within the same bar, reducing overtrading
- Automatic 5/3-digit broker adjustment ensures correct SL/TP values across different broker types
- Clear and concise strategy logic with dual MA directional consistency filter reduces false signals
- Position check mechanism avoids duplicate entries in the same direction
Weaknesses
- Fixed 1.0 lot with no money management logic poses excessive risk for large accounts and insufficient capital for small ones
- 1:1 risk-reward ratio is suboptimal for trend following which typically needs wider profit targets
- ORDER_FILLING_FOK fill mode may cause order rejections during low liquidity periods
- No spread filter means entries during high-spread periods may be unfavorable
- Error handling is incomplete - OrderSend checks retcode but lacks handling for partial failure scenarios
Possible improvements
- Add dynamic position sizing based on account balance and risk percentage instead of fixed lots
- Add spread filter and trading session filter to avoid unfavorable entries during high-spread or inactive periods
- Consider variable SL/TP or trailing stop to give trend-following trades more room for profit
- Improve order filling mode by preferring ORDER_FILLING_IOC with a retry mechanism
Risk assessment
Overall risk: Medium
- Fixed 1.0 lot without money management leads to uncontrolled risk exposure across different account sizes
- No spread filter means entry prices can significantly deviate from expectations in high-spread environments
- Single position check without magic number filtering may conflict with other EAs on the same symbol
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
StopLoss | 100 | Stop-loss in points |
TakeProfit | 100 | Take-profit in points |
MA_Period | 57 | Slow EMA period |
MA_Period1 | 3 | Fast LWMA period |
EA_Magic | 12345 | EA magic number |
Lot | 1.0 | Fixed trading lot size |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.