EMA_RSI_RISK_EA
This EA combines EMA trend direction with RSI momentum signals to generate trade entries, while incorporating risk management rules based on account equity and position sizing. It opens buy positions when price is above EMA and RSI confirms upward momentum, and sell positions when price is below EMA and RSI confirms downward momentum. The strategy applies fixed risk-per-trade position sizing and includes stop loss and take profit controls.
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.12% | -2.72% | 4.09% | 114 | 46.90% | -0.71 | -0.76 | 5 | −$2.46 | Reliable |
| GBPUSD | -1.43% | -1.24% | 4.85% | 117 | 44.80% | -0.23 | -0.29 | 8 | −$1.02 | Reliable |
| USDJPY | -3.92% | -3.41% | 7.60% | 117 | 47.40% | -0.75 | -0.52 | 6 | −$3.51 | Reliable |
| XAUUSD | +11.32% | +9.26% | 52.86% | 111 | 50.00% | 0.48 | 0.21 | 7 | +$12.54 | 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 Momentum EAs with a reliable result on the same market: EURUSD: better than 31% of 68 · GBPUSD: better than 44% of 66 · USDJPY: better than 25% of 68 · XAUUSD: better than 59% of 75
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +1.57% 2026-04 | -1.36% 2026-01 |
| GBPUSD | 54% | +1.40% 2026-08 | -2.75% 2026-10 |
| USDJPY | 38% | +3.03% 2026-04 | -4.23% 2026-08 |
| XAUUSD | 54% | +48.49% 2026-02 | -28.34% 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 EA's strategy concept is based on dual indicator filtering: EMA determines the main trend direction while RSI confirms momentum strength, and the combination of both generates entry signals. Entry conditions require: for long entries, price must be above EMA and RSI must confirm upward momentum, either recovering from oversold levels or exceeding a threshold; for short entries, price must be below EMA and RSI must confirm downward momentum, either declining from overbought levels or falling below a threshold. Exit conditions rely on pre-set stop loss and take profit levels, and may also include early exits triggered by RSI reversal signals. Position sizing employs risk-based calculation tied to account equity percentage, where the risk amount per trade is predetermined and the stop loss distance determines the lot size. Money management protects the account by limiting maximum risk percentage per trade and may include constraints on maximum number of open positions. The overall strategy logic is clear and represents a typical trend-following system with momentum confirmation, suitable for markets with well-defined trends.
Strengths
- Dual indicator filtering reduces false signals — EMA determines direction and RSI confirms timing with clear logic
- Risk-percentage-based position sizing is scientifically sound and automatically adjusts lot size according to account size
- Stop loss, take profit, and maximum position limits provide a complete risk management framework that prevents overtrading
Weaknesses
- Both EMA and RSI are lagging indicators, prone to generating frequent false signals in ranging markets leading to consecutive losses
- Lacks market regime filtering (e.g., ATR or volatility assessment), so stop losses may be too tight in low-volatility environments and easily triggered by noise
- No new bar check mechanism means the EA could potentially open multiple positions on the same bar, increasing risk exposure
Possible improvements
- Add ATR-based dynamic stop loss and take profit mechanism to automatically adjust stop distance based on market volatility, avoiding fixed-pip stops that are misaligned during extreme market conditions
- Add a new bar detection function to ensure signals are calculated only once per bar, preventing duplicate entries; also add ADX or volatility filter to exclude ranging/choppy market conditions
Risk assessment
Overall risk: Medium
- Lack of new bar checking may cause duplicate position openings on the same bar, increasing unplanned risk exposure
- Fixed-pip stop loss may be too small during high-volatility periods causing frequent stop-outs, or too large during low-volatility periods reducing reward-to-risk ratio
- No spread or slippage check means orders may be filled at unfavorable prices during low-liquidity sessions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
EmaPeriod | 200 | EMA period for determining main trend direction |
RsiPeriod | 14 | RSI period for confirming momentum strength |
RsiOverbought | 70 | RSI overbought threshold |
RsiOversold | 30 | RSI oversold threshold |
RiskPercent | 1.0 | Risk per trade as percentage of account equity |
StopLoss | 50 | Stop loss in pips per order |
TakeProfit | 100 | Overall grid profit target in currency |
MaxPositions | 1 | Maximum simultaneous positions |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.