One MA EA
This EA trades based on a single Moving Average indicator, opening buy positions when price crosses above the MA and sell positions when price crosses below. It uses the MA as a dynamic trend filter and signal generator, with configurable period, method, and applied price. The EA is a straightforward trend-following system that relies on MA crossovers for entry and typically uses opposite signals or fixed take-profit/stop-loss for exits.
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.72% | +4.09% | 2.42% | 134 | 48.10% | 1.17 | 1.95 | 5 | +$3.81 | Reliable |
| GBPUSD | -1.03% | -0.90% | 4.97% | 135 | 50.70% | -0.14 | -0.21 | 5 | −$0.59 | Reliable |
| USDJPY | +5.72% | +4.96% | 3.30% | 134 | 53.00% | 0.98 | 1.73 | 7 | +$4.27 | Reliable |
| XAUUSD | +94.61% | +73.34% | 35.14% | 141 | 52.90% | 1.16 | 2.69 | 7 | +$69.35 | Reliable |
Profitable on 3 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 86% of 95 · GBPUSD: better than 38% of 95 · USDJPY: better than 98% of 95 · XAUUSD: better than 86% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 77% | +2.59% 2026-03 | -1.27% 2026-09 |
| GBPUSD | 46% | +3.95% 2026-04 | -2.91% 2026-03 |
| USDJPY | 54% | +2.65% 2026-09 | -1.64% 2026-01 |
| XAUUSD | 69% | +52.71% 2026-02 | -12.97% 2026-05 |
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
This EA uses a single Moving Average as the core indicator for trend determination, with a straightforward strategy concept—price above the MA is considered an uptrend for buying, and price below the MA is considered a downtrend for selling. Entry conditions are typically based on price-MA crossovers: a buy position is opened when the close price crosses above the MA, and a sell position when it crosses below. Exit conditions may include closing on opposite crossover signals, fixed take-profit and stop-loss levels, or a combination of both. Position sizing is typically handled with fixed lots, lacking dynamic sizing based on volatility or account risk percentage. Money management is relatively basic, likely relying only on stop-loss to control per-trade loss without additional rules such as maximum drawdown limits or position reduction after consecutive losses. The overall strategy logic is clear but simplistic, making it prone to frequent false signals and consecutive losses during choppy or ranging market conditions.
Strengths
- Simple and clear strategy logic, easy to understand and debug
- Single indicator reduces the risk of parameter overfitting
- Effectively captures medium-to-long-term trends in trending markets
- Clean code structure, suitable as a beginner EA for learning MQL5
- Multiple configurable parameters for adaptation to different instruments and timeframes
Weaknesses
- Single MA signal has significant lag, resulting in late entries
- Frequent false signals during ranging/choppy markets lead to consecutive losses
- Lacks dynamic position sizing, unable to adjust risk exposure based on market volatility
- May lack duplicate order prevention and new bar detection, potentially opening multiple orders on the same signal
- No spread filter or trading session filter, slippage costs may be high
Possible improvements
- Add a second MA or ADX as trend strength filter to reduce false signals in ranging markets
- Implement ATR-based dynamic stop-loss, take-profit and position sizing for better risk-adjusted returns
- Add new bar detection and signal deduplication to prevent duplicate orders on the same signal
- Add spread filter and trading session restrictions to reduce costs in unfavorable trading conditions
- Add trailing stop functionality to protect floating profits
Risk assessment
Overall risk: Medium
- Lack of new bar detection may cause duplicate order opening within the same bar
- Fixed lot size not dynamically adjusted based on account equity and volatility
- Single MA strategy prone to consecutive stop-losses in ranging markets
- Stop-loss may be insufficient or zero, leading to unlimited risk exposure
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MA_Period | 200 | Moving average period |
MA_Method | MODE_SMA | MA method (Simple/Exponential/Weighted/Smoothed) |
MA_Applied_Price | PRICE_CLOSE | MA applied price type |
LotSize | 0.1 | Fixed lot size (used when MMRec disabled) |
Stop_Loss | 0 | Stop loss in points (0 to disable) |
Take_Profit | 0 | Take profit in points (0 to disable) |
Magic_Number | 12345 | EA magic number for distinguishing orders |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.