Expert_2EMA_ITF
This EA uses a dual EMA crossover signal filtered by an ITF (Intraday Time Filter) module, which restricts trading to specific minutes, hours, and days. It combines fast/slow EMA crossover with ATR-based volatility limits and fixed-lot money management, placing pending orders with defined stop-loss, take-profit, and expiration.
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.54% | -3.08% | 4.93% | 106 | 46.70% | -0.90 | -0.72 | 7 | −$3.05 | Reliable |
| GBPUSD | +4.43% | +3.83% | 4.40% | 106 | 50.00% | 0.82 | 1.01 | 8 | +$4.18 | Reliable |
| USDJPY | +4.09% | +3.54% | 3.31% | 98 | 50.00% | 0.91 | 1.24 | 6 | +$4.17 | Reliable |
| XAUUSD | -7.65% | -6.37% | 52.35% | 99 | 54.10% | 0.34 | -0.15 | 6 | −$5.28 | 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 18% of 95 · GBPUSD: better than 80% of 95 · USDJPY: better than 88% of 95 · XAUUSD: better than 43% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +1.40% 2026-04 | -1.84% 2026-01 |
| GBPUSD | 69% | +2.40% 2026-04 | -2.61% 2026-10 |
| USDJPY | 62% | +2.28% 2026-04 | -1.89% 2026-03 |
| XAUUSD | 62% | +23.03% 2026-09 | -28.26% 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 a dual EMA crossover trend-following approach with a fast EMA period of 5 and a slow EMA period of 30, going long when the fast EMA crosses above the slow EMA and short on the reverse crossover. Entry conditions are further filtered by an ATR indicator (period 7) with a Limit parameter (1.2) to avoid entering during low-volatility consolidation phases. Exit conditions use fixed stop-loss (5.0) and take-profit (8.0) levels, with pending orders automatically cancelled after an expiration of 4 bars if not filled. Position sizing uses a fixed lot model (0.1 lots) that does not dynamically scale based on account equity or balance. Money management employs the CMoneyFixedLot class with a 10% percent parameter, but the actual lot size remains fixed without any dynamic position scaling mechanism. The ITF (Intraday Time Filter) module allows users to specify good and bad trading minutes, hours, and days of the week, effectively avoiding false signals during low-liquidity or high-volatility sessions. The strategy uses no trailing stop (CTrailingNone), meaning stop-loss levels are not dynamically adjusted once a position is opened.
Strengths
- The ITF time filter effectively avoids false signals during low-liquidity sessions, improving entry quality
- ATR volatility filtering prevents frequent entries during ranging markets, reducing ineffective trades
- Uses MetaQuotes standard library architecture with clear code structure and high modularity
- Pending order expiration mechanism prevents unfilled orders from occupying margin indefinitely
Weaknesses
- Fixed lot sizing does not dynamically adjust based on account size, resulting in low capital utilization
- No trailing stop means profitable positions cannot lock in floating gains, risking profit givebacks
- The 5/30 EMA combination is prone to frequent false crossover signals in ranging markets
- Stop-loss and take-profit use fixed point values instead of ATR multiples, ignoring volatility changes
Possible improvements
- Change stop-loss and take-profit to ATR-multiple calculations for volatility-adaptive risk parameters
- Add a trailing stop module to replace CTrailingNone for profit protection
- Replace fixed lot sizing with dynamic position management based on ATR and account risk
Risk assessment
Overall risk: Medium
- No trailing stop means profitable positions may give back all gains on reversal
- Fixed-point stop-loss does not account for reasonableness across different instruments and volatility environments
- Large gap between fast and slow EMA periods may delay trend entries, leaving insufficient stop-loss room
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Inp_Signal_TwoEMAwithITF_PeriodFastEMA | 5 | Fast EMA period |
Inp_Signal_TwoEMAwithITF_PeriodSlowEMA | 30 | Slow EMA period |
Inp_Signal_TwoEMAwithITF_PeriodATR | 7 | ATR indicator period |
Inp_Signal_TwoEMAwithITF_Limit | 1.2 | ATR volatility limit threshold |
Inp_Signal_TwoEMAwithITF_StopLoss | 5.0 | Stop loss in points |
Inp_Signal_TwoEMAwithITF_TakeProfit | 8.0 | Take profit in points |
Inp_Signal_TwoEMAwithITF_Expiration | 4 | Pending order expiration in bars |
Inp_Signal_TwoEMAwithITF_GoodMinuteOfHour | -1 | Allowed trading minutes within hour (-1 for all) |
Inp_Signal_TwoEMAwithITF_BadMinutesOfHour | 0 | Excluded trading minutes bitmask within hour |
Inp_Signal_TwoEMAwithITF_GoodHourOfDay | -1 | Allowed trading hours (-1 for all) |
Inp_Signal_TwoEMAwithITF_BadHoursOfDay | 0 | Excluded trading hours bitmask |
Inp_Signal_TwoEMAwithITF_GoodDayOfWeek | -1 | Allowed trading days of week (-1 for all) |
Inp_Signal_TwoEMAwithITF_BadDaysOfWeek | 0 | Excluded trading days bitmask |
Inp_Money_FixLot_Percent | 10.0 | Risk percentage for fixed lot money management |
Inp_Money_FixLot_Lots | 0.1 | Fixed trading lot size |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.