YY Cross MA
This EA implements a dual moving average crossover strategy, generating buy signals when a fast MA crosses above a slow MA and sell signals when the fast MA crosses below the slow MA. It is a classic trend-following system that aims to capture directional moves by riding the trend after a crossover confirmation. The EA automates entry and exit based on the MA cross signals with configurable parameters for MA periods, methods, and applied prices.
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.06% | -3.54% | 5.02% | 107 | 40.60% | -1.03 | -0.81 | 7 | −$3.51 | 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 15% 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 | 38% | +1.43% 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
This EA employs a dual moving average crossover strategy as its core trading logic, representing a classic trend-following system. Entry conditions are triggered when the fast MA crosses above the slow MA for buy signals, and when the fast MA crosses below the slow MA for sell signals. Exit conditions are typically based on reverse crossover signals that close existing positions and open new ones in the opposite direction, or through configurable stop-loss and take-profit parameters. Position sizing depends on the lot size parameter configuration, potentially supporting either fixed lot sizes or equity-based dynamic sizing. Money management is addressed through stop-loss and take-profit parameters that control the risk-reward ratio for each trade. The overall strategy logic is straightforward and intuitive, but it is prone to generating frequent false signals during ranging or choppy market conditions, leading to consecutive losses. The strategy lacks a market regime filter to distinguish between trending and sideways markets, and does not account for the impact of trading costs and slippage on frequent signal turnover.
Strengths
- Strategy logic is simple and clear, easy to understand and verify, suitable for beginners learning trend-following fundamentals
- MA crossover is a time-tested classic strategy that performs well during strong trending markets
- High configurability allows users to adjust MA periods, methods, and applied prices to adapt to different markets and timeframes
Weaknesses
- Generates numerous false signals during ranging markets, leading to frequent open/close cycles and consecutive losses
- Lacks a market regime filter to distinguish between trending and sideways market conditions
- Default stop-loss and take-profit of 0 poses risk of unlimited single-trade losses without protective stops
- MA crossover signals are inherently lagging, often triggering entries only after a significant portion of the trend has already played out
Possible improvements
- Add a market regime filter (such as ADX indicator or volatility filter) to reduce or suspend trading signals during ranging markets
- Implement a new bar check mechanism to ensure trading only once per bar at opening, preventing duplicate signals within the same bar
- Add a trailing stop feature to lock in trend profits and avoid excessive give-back of gains
Risk assessment
Overall risk: Medium
- Default stop-loss of 0 means single-trade risk is uncontrolled if not manually configured
- MA crossover strategy is prone to frequent false signals in ranging markets, accumulating consecutive small losses
- Lack of new bar check may cause multiple trade signals within the same bar, increasing transaction costs
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
FastMA_Period | 10 | Fast MA period |
SlowMA_Period | 30 | Slow MA period |
FastMA_Method | MODE_SMA | fastMAmethod (SMA/EMA/SMMA/LWMA) |
SlowMA_Method | MODE_SMA | slowMAmethod (SMA/EMA/SMMA/LWMA) |
FastMA_AppliedPrice | PRICE_CLOSE | fastMAapplied price type |
SlowMA_AppliedPrice | PRICE_CLOSE | slowMAapplied price type |
LotSize | 0.1 | Trading lot size |
StopLoss | 0 | stop losspoints (0meansnostop 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.