Universal Investor
This EA uses a dual moving average crossover system combining EMA and LWMA of the same period to generate trend-following signals. It opens buy positions when LWMA is above EMA and both are rising, and sell positions when LWMA is below EMA and both are falling. Position sizing includes an optional loss-based lot reduction mechanism to scale down after consecutive losing trades.
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 | -0.80% | -0.69% | 7.30% | 94 | 44.70% | -0.16 | -0.11 | 5 | −$1.22 | Reliable |
| GBPUSD | -4.17% | -3.64% | 9.29% | 97 | 41.20% | -0.59 | -0.45 | 5 | −$4.59 | Reliable |
| USDJPY | -1.82% | -1.58% | 6.75% | 94 | 39.40% | -0.28 | -0.27 | 8 | −$1.79 | Reliable |
| XAUUSD | +13.06% | +10.67% | 71.07% | 86 | 44.20% | 0.72 | 0.18 | 9 | +$18.89 | Reliable |
Profitable on 1 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 48% of 95 · GBPUSD: better than 18% of 95 · USDJPY: better than 34% of 95 · XAUUSD: better than 64% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +2.17% 2026-01 | -2.99% 2026-03 |
| GBPUSD | 31% | +3.11% 2026-09 | -2.84% 2026-02 |
| USDJPY | 54% | +1.90% 2026-09 | -1.99% 2026-05 |
| XAUUSD | 62% | +61.05% 2026-03 | -31.74% 2026-02 |
From the backtest equity curve, sampled about every two days; only reliable results.
Strategy analysis
The strategy concept is based on the crossover of LWMA and EMA of the same period to determine trend direction; LWMA assigns higher weight to recent prices, making it more responsive than EMA, and their crossover serves as a trend reversal signal. Entry conditions: going long requires LWMA above EMA (short-term momentum upward) and both LWMA and EMA above their previous values (trend confirmation), while going short is the mirror condition. Exit conditions: long positions are closed when LWMA falls below EMA, and short positions are closed when LWMA rises above EMA, representing a reversal-based exit rather than fixed stop-loss or take-profit levels. Position sizing offers two modes: fixed lots or dynamic lots calculated from free margin multiplied by the risk percentage. The DecreaseFactor mechanism in money management progressively reduces lot size after consecutive losing trades—the more losses, the greater the reduction—which helps control drawdown, but the strategy lacks explicit stop-loss protection, relying entirely on indicator signals for exits.
Strengths
- Dual MA confirmation (crossover + same-direction movement) reduces false signals compared to simple MA crossover
- DecreaseFactor loss-reduction mechanism helps control risk exposure during consecutive losing streaks
- Clean code structure with well-separated modules for signal logic, position sizing, and trade execution
- New bar check mechanism (LastTime) prevents duplicate entries within the same bar
Weaknesses
- No stop-loss or take-profit set—exits rely entirely on indicator reversal signals, which can lead to excessive single-trade losses
- Lot calculation formula (free margin × risk / 1000) lacks theoretical justification and does not account for ATR or pip value
- DecreaseFactor reduction logic when losses barely exceed 1 may result in excessively small position sizes
- The mutual exclusion logic between buy and sell signals may fail to handle conflicting signals correctly
Possible improvements
- Add stop-loss and take-profit parameters, at minimum an ATR-based stop-loss to cap maximum per-trade loss
- Improve the lot calculation formula to use a proper risk-based approach accounting for ATR or pip value instead of the arbitrary division by 1000
- Add trading session filters to avoid generating false signals during low-liquidity periods
Risk assessment
Overall risk: Medium
- No stop-loss configured—delayed reversal signals in strong trends can cause significant losses
- Position sizing does not consider volatility—high-volatility instruments may result in oversized positions
- Closing with 3x spread deviation may still fail to execute in extreme market conditions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MovingPeriod | 23 | MA smoothing period, applied to both EMA and LWMA |
MaximumRisk | 0.05 | Maximum risk percentage for dynamic lot sizing when Lots=0 |
Lots | 0.1 | Fixed lot size; set to 0 for dynamic sizing |
DecreaseFactor | 0 | Lot decrease factor after consecutive losses; 0 disables |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.