EMA_WMA
This EA implements a dual moving average crossover strategy using an Exponential Moving Average (EMA) and a Weighted Moving Average (WMA). It generates buy signals when the faster EMA crosses above the slower WMA and sell signals when the EMA crosses below the WMA. The system automates trend-following entry and exit based on these crossover events.
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 | -3.49% | -3.04% | 4.87% | 125 | 50.00% | -0.74 | -0.72 | 4 | −$2.54 | Reliable |
| GBPUSD | +7.12% | +6.16% | 4.47% | 124 | 54.50% | 1.21 | 1.59 | 9 | +$5.99 | Reliable |
| USDJPY | +4.09% | +3.55% | 6.49% | 128 | 55.10% | 0.71 | 0.63 | 5 | +$3.10 | Reliable |
| XAUUSD | +17.07% | +13.90% | 54.73% | 128 | 51.20% | 0.56 | 0.31 | 5 | +$15.39 | 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 20% of 95 · GBPUSD: better than 94% of 95 · USDJPY: better than 88% of 95 · XAUUSD: better than 65% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +0.82% 2025-12 | -1.57% 2026-01 |
| GBPUSD | 69% | +2.79% 2026-02 | -2.28% 2026-03 |
| USDJPY | 46% | +2.98% 2026-04 | -2.30% 2025-11 |
| XAUUSD | 54% | +54.43% 2026-02 | -25.19% 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 core strategy concept of this EA is to use the crossover of two different types of moving averages—EMA and WMA—to determine trend direction and generate trading signals. Entry conditions are: open a long position when the EMA crosses above the WMA from below (golden cross), and open a short position when the EMA crosses below the WMA from above (death cross), which is a classic dual MA crossover approach. Exit conditions typically rely on the reverse crossover signal to close positions—closing longs when EMA crosses below WMA and closing shorts when EMA crosses above WMA. Position sizing likely uses either a fixed lot size or a simple account-balance-based calculation, but lacks an advanced position scaling or anti-martingale mechanism. Money management relies on the trend-following nature of MA crossovers, but the strategy is vulnerable to frequent false signals and consecutive losses during ranging or choppy market conditions. Overall, the strategy lacks explicit stop-loss and take-profit settings as well as auxiliary filters for ranging markets, making its risk control relatively weak.
Strengths
- The strategy logic is simple and clear, easy to understand and debug
- Uses two different types of moving averages (EMA and WMA), combining the advantages of exponential smoothing and weighted smoothing with different response speeds to price changes
- Effectively captures medium-term trends in trending markets, enabling trend-following trades
Weaknesses
- MA crossover signals have inherent lag, often entering after the trend has already moved significantly
- Frequent false crossover signals in ranging markets lead to consecutive stop-losses and commission drain
- Lacks explicit stop-loss and take-profit settings, relying entirely on reverse crossover for exit carries significant risk
- No market filter (such as ADX, volatility, etc.) to distinguish between trending and ranging conditions
Possible improvements
- Add an ADX or volatility filter to pause trading during ranging markets and reduce false signals
- Add explicit stop-loss/take-profit mechanisms and a trailing stop feature to improve risk management and profit protection
Risk assessment
Overall risk: Medium
- Lacks explicit stop-loss, may suffer significant losses in extreme market conditions
- Frequent false signals in ranging markets lead to consecutive losses
- Position sizing is simplistic, not considering overall account risk exposure
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
EmaPeriod | 10 | EMA period controlling fast moving average sensitivity |
WmaPeriod | 20 | WMA period controlling slow moving average smoothness |
LotSize | 0.1 | Fixed lot size per trade |
MagicNumber | 12345 | EA magic number for order identification |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.