Moving Averages
This EA is a classic moving average crossover system that generates buy signals when a fast moving average crosses above a slow moving average, and sell signals when the fast MA crosses below the slow MA. It opens positions based on these crossover events and typically includes configurable MA periods and lot sizing. The strategy is a foundational trend-following approach suitable for trending markets.
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 | -5.82% | -5.08% | 6.93% | 118 | 43.60% | -1.25 | -0.84 | 7 | −$4.69 | Reliable |
| GBPUSD | -3.38% | -2.94% | 5.74% | 122 | 52.50% | -0.52 | -0.59 | 5 | −$2.77 | Reliable |
| USDJPY | -2.41% | -2.10% | 8.27% | 119 | 52.50% | -0.45 | -0.29 | 9 | −$1.91 | Reliable |
| XAUUSD | -63.52% | -56.53% | 84.89% | 118 | 47.90% | -0.60 | -0.75 | 6 | −$52.17 | Reliable |
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 8% of 95 · GBPUSD: better than 23% of 95 · USDJPY: better than 28% of 95 · XAUUSD: better than 18% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 23% | +2.06% 2026-03 | -2.17% 2026-06 |
| GBPUSD | 46% | +1.82% 2026-04 | -2.23% 2026-03 |
| USDJPY | 46% | +2.59% 2026-07 | -3.51% 2026-01 |
| XAUUSD | 46% | +27.50% 2026-11 | -43.04% 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
This EA is based on a moving average crossover strategy, which is a classic trend-following approach. Entry conditions are a golden cross (fast MA crossing above slow MA) for buy signals and a death cross (fast MA crossing below slow MA) for sell signals, triggered at the moment of crossover. Exit conditions typically rely on reverse crossover signals or fixed stop-loss/take-profit levels, with some versions potentially including trailing stop functionality. Position sizing uses a fixed lot approach with a small default lot size, lacking dynamic adjustment based on account balance. Money management is relatively simple, with no dynamic risk ratio calculation or equity curve protection logic. The overall strategy logic is clear and easy to understand, but it tends to generate frequent false signals in ranging markets, leading to consecutive losses.
Strengths
- Clear and simple strategy logic, easy to understand and verify
- High configurability with customizable MA periods and lot sizes
- Performs well in trending markets, capable of capturing medium-to-long-term trends
- Well-structured code, suitable as a beginner example for learning MQL5 programming
- Includes risk ratio and decrease factor parameters providing a basic money management framework
Weaknesses
- Generates frequent false signals in ranging markets leading to consecutive losses
- Lacks advanced filtering mechanisms such as ADX trend strength or multi-timeframe confirmation
- Fixed lot sizing is inflexible, not dynamically adjusted based on volatility
- Stop-loss and take-profit settings are inadequate, default values may be zero leading to excessive risk exposure
- No new bar check mechanism, potentially opening duplicate positions on the same bar
Possible improvements
- Add ADX or trend strength filter to reduce false signals in ranging markets
- Implement multi-timeframe confirmation to improve signal reliability
- Implement ATR-based dynamic stop-loss and position sizing
Risk assessment
Overall risk: Medium
- Default stop-loss may be zero, creating unlimited loss risk
- No new bar check, potentially opening multiple positions on a single bar causing overtrading
- Lacks spread filter, may enter trades inappropriately during high-spread conditions
- Consecutive false signals in ranging markets can cause significant drawdown
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.1 | Lot size per trade |
MaximumRisk | 0.02 | maximumrisk ratio |
DecreaseFactor | 3 | Lot reduction factor after loss |
MovingPeriodFast | 12 | Fast MA period |
MovingPeriodSlow | 26 | Slow MA period |
MovingShift | 0 | MA offset |
StopLoss | 0 | Auto stop loss in points |
TakeProfit | 0 | Auto take profit in points |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.