Crossing of two iMA v2
This EA trades based on the crossover of two Moving Averages (iMA). It opens a buy position when the fast MA crosses above the slow MA and a sell position when the fast MA crosses below the slow MA, closing opposite positions on signal reversal.
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.68% | -0.60% | 3.81% | 110 | 47.70% | -0.16 | -0.18 | 4 | −$0.32 | Reliable |
| GBPUSD | +6.46% | +5.59% | 3.89% | 110 | 50.90% | 1.18 | 1.66 | 8 | +$5.87 | Reliable |
| USDJPY | +1.74% | +1.51% | 5.35% | 104 | 48.10% | 0.38 | 0.33 | 6 | +$1.67 | Reliable |
| XAUUSD | +5.76% | +4.73% | 51.23% | 105 | 50.00% | 0.42 | 0.11 | 7 | +$7.92 | 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 49% of 95 · GBPUSD: better than 91% of 95 · USDJPY: better than 73% of 95 · XAUUSD: better than 57% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +2.69% 2026-04 | -1.12% 2026-01 |
| GBPUSD | 62% | +2.67% 2026-04 | -2.56% 2026-10 |
| USDJPY | 54% | +3.04% 2026-04 | -1.93% 2026-03 |
| XAUUSD | 62% | +28.90% 2026-02 | -28.86% 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 strategy is a classic dual moving average crossover trend-following system. Entry conditions: a buy is triggered when the fast moving average crosses above the slow moving average, and a sell is triggered when the fast MA crosses below the slow MA. Exit conditions: when a reversal crossover signal occurs, the EA closes the current position and may open a reverse position. Position sizing uses a fixed lot size approach, with the user setting the trade volume via input parameters. For money management, the EA provides stop loss and take profit parameters for the user to configure, but lacks dynamic position sizing or account-balance-proportional money management. The overall strategy logic is simple and clear, suitable for strongly trending markets, but is prone to frequent false signals and consecutive losses in choppy or ranging markets.
Strengths
- Simple and clear strategy logic, easy to understand and verify
- Classic trend-following approach that performs well in strong trending markets
- Highly configurable parameters allow optimization for different instruments and timeframes
Weaknesses
- Prone to frequent false signals and consecutive losses in choppy/ranging markets
- Lacks dynamic position sizing; fixed lot size does not adapt to different account sizes
- Default stop loss and take profit are 0, risking significant losses if not manually configured
- No new bar check mechanism, potentially opening multiple positions within the same bar
Possible improvements
- Add new bar detection logic to prevent repeated trading within the same bar
- Implement ATR-based dynamic stop loss or trailing stop to improve risk management
- Add a trend filter (e.g., higher timeframe MA direction confirmation) to reduce false signals in ranging markets
Risk assessment
Overall risk: Medium
- Default SL/TP of 0 exposes the account to unlimited loss risk if user forgets to set them
- Lack of new bar check may cause repeated position opening within the same bar
- Fixed lot size without proportional money management may lead to overleveraging on small accounts
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
FastMA_Period | 9 | Fast moving average period |
SlowMA_Period | 21 | Slow moving average period |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 0 | Stop loss in points, 0 means no stop loss |
TakeProfit | 0 | Take profit in points, 0 means no take profit |
MA_Method | MODE_SMA | Moving average calculation method |
MA_Applied_Price | PRICE_CLOSE | Moving average applied price |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.