2MA_RSI
This EA trades based on a dual EMA crossover filtered by RSI overbought/oversold levels, and employs a Martingale position sizing system that doubles lot size after losses. It opens buy orders when the fast EMA crosses above the slow EMA with RSI below the oversold threshold, and sell orders on the reverse crossover with RSI above the overbought threshold. Positions include fixed stop-loss and take-profit levels, and the Martingale lot multiplier resets via global variables across restarts.
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.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
Why this EA never traded: its entry needs a signal and an extreme oscillator reading on the same bar, which did not happen in one year of hourly data.
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.
Blow-up risk: Elevated
- Increases the position size after losses (martingale)
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 combines a dual EMA crossover with RSI filtering: the fast and slow EMA golden/death cross serves as the primary signal, while RSI overbought/oversold levels act as filters to prevent chasing entries in extreme zones. Entry conditions require the fast EMA crossing above the slow EMA with RSI below the oversold level (default 30) for buys, and the reverse crossover with RSI above the overbought level (default 70) for sells. Exit conditions rely on fixed stop-loss (500 points) and take-profit (1500 points), achieving a 3:1 reward-to-risk ratio. Position sizing uses a Martingale system via the Martingail class, doubling lot size after losses with the Ud parameter controlling the number of doubling steps, and DML (default 1000) defining the base lot unit. Money management persists the Martingale state through global variables so the EA can resume its progression after restarts, but there is no maximum drawdown protection or account equity-proportional sizing.
Strengths
- Dual EMA crossover with RSI filter avoids entering at trend exhaustion, providing reasonable entry logic
- 3:1 reward-to-risk ratio (1500:500) aligns with trend-following principles for high reward trades
- Global variables persist Martingale state across EA restarts, improving robustness of position sizing
- Custom OnTester metric (profit-loss ratio divided by max consecutive loss) enables better strategy optimization
Weaknesses
- Martingale position sizing is extremely dangerous — consecutive losses cause exponential lot growth that can blow the account
- No new bar check; only tick_volume>1 filtering, which is unreliable for preventing repeated signal triggers
- No spread filter, trading session filter, or insufficient margin check, creating risks in live trading
- Fixed pip stop-loss and take-profit instead of ATR-adaptive levels perform inconsistently across volatility regimes
- Only one position allowed at a time (PositionSelect), limiting strategy flexibility
Possible improvements
- Remove Martingale sizing and replace with fixed-fractional risk management, risking no more than 2% of account per trade
- Add new bar detection (compare current bar time vs last trade time) to prevent multiple entries on the same bar
- Add spread filter and trading session filter to avoid trading during high-spread or low-liquidity periods
- Change stop-loss and take-profit to ATR-based dynamic calculation for better adaptation to varying volatility
Risk assessment
Overall risk: Dangerous
- Martingale system causes exponential lot growth during consecutive losses, potentially rapidly depleting account funds
- No maximum loss limit or account equity protection mechanism exists
- tick_volume filtering is unreliable and may allow multiple entries on the same bar
- No spread check — high-spread periods can cause excessive slippage
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
DML | 1000 | Martingale base lot unit |
Ud | 1 | Martingale doubling count |
Stop | 500 | Stop loss in points |
Tp | 1500 | Take profit in points |
Slipage | 50 | Allowed slippage |
PeriodFast | 5 | Fast EMA period |
PeriodSlow | 20 | Slow EMA period |
ShiftFast | 0 | Fast EMA shift |
ShiftSlow | 0 | Slow EMA shift |
RSI | 14 | RSI period |
Perekup | 70 | RSI overbought threshold |
Pereprod | 30 | RSI oversold threshold |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.