CrossMA
A moving average crossover EA that generates trade signals when a fast moving average crosses a slow moving average. It enters long when the fast MA crosses above the slow MA and enters short when the fast MA crosses below the slow MA, following the emerging trend direction.
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 | -1.99% | -1.73% | 3.98% | 107 | 43.40% | -0.48 | -0.50 | 7 | −$1.56 | Reliable |
| GBPUSD | +6.24% | +5.40% | 3.00% | 110 | 53.60% | 1.21 | 2.08 | 7 | +$5.67 | Reliable |
| USDJPY | +0.34% | +0.30% | 4.44% | 105 | 48.60% | 0.09 | 0.08 | 6 | +$0.33 | Reliable |
| XAUUSD | -27.93% | -23.71% | 62.63% | 106 | 50.50% | 0.17 | -0.45 | 5 | −$24.24 | 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 35% of 95 · GBPUSD: better than 87% of 95 · USDJPY: better than 57% of 95 · XAUUSD: better than 32% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +2.72% 2026-04 | -1.84% 2026-01 |
| GBPUSD | 62% | +3.09% 2026-04 | -2.05% 2026-01 |
| USDJPY | 38% | +3.01% 2026-04 | -1.91% 2026-03 |
| XAUUSD | 46% | +40.91% 2026-04 | -30.89% 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 based on dual moving average crossover, a classic trend-following approach. Entry conditions trigger when the fast MA crosses above the slow MA for longs and below for shorts. Exit conditions are typically the reverse crossover signal or fixed stop-loss and take-profit levels. Position sizing usually employs fixed lots or account-balance-based dynamic lot calculation. Money management may include risk percentage calculation, but basic EAs of this type typically lack advanced money management features. The strategy performs well in strongly trending markets but generates numerous false signals and frequent losses during ranging or choppy conditions.
Strengths
- Strategy logic is simple and clear, easy to understand and verify
- Captures significant trend moves in trending markets
- Few parameters mean relatively low overfitting risk
- Clean codebase, easy to modify and extend
Weaknesses
- Frequent false signals in ranging markets lead to consecutive losses
- MA crossover signals are lagging, entering late and missing early trend moves
- Lacks trend filter mechanism, opens positions even in non-trending markets
- Missing advanced risk controls like trailing stops or position scaling
Possible improvements
- Add ADX or ATR as trend filter to reduce false trades in ranging markets
- Implement trailing stop to protect profits and improve risk-reward ratio
- Add multi-timeframe confirmation to improve signal quality
Risk assessment
Overall risk: Medium
- Lagging MA crossover signals may result in poor entry prices
- Lack of trend filter causes frequent position opening in ranging markets, draining capital
- Default stop-loss of 0 presents unlimited loss risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
FastMA_Period | 10 | Fast MA period |
SlowMA_Period | 30 | Slow MA period |
MA_Method | MODE_SMA | MAmethod (SMA/EMA/SMMA/LWMA) |
MA_AppliedPrice | PRICE_CLOSE | MA applied price type |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 0 | Stop loss in points (0 = no stop loss) |
TakeProfit | 0 | take profitpoints (0meansnotake profit) |
MagicNumber | 12345 | EA magic number for identifying this EA's orders |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.