iMA iStdDev
This EA uses a combination of Moving Average (iMA) and Standard Deviation (iStdDev) indicators to identify trend-following trading opportunities. It enters trades when price confirms a trend direction via the MA and volatility conditions are met via the StdDev filter. The strategy aims to capture directional moves while filtering out low-volatility sideways markets.
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.37% | -2.94% | 4.68% | 111 | 44.50% | -0.82 | -0.72 | 7 | −$2.76 | Reliable |
| GBPUSD | -1.32% | -1.15% | 4.94% | 115 | 50.40% | -0.21 | -0.27 | 6 | −$1.15 | Reliable |
| USDJPY | +1.45% | +1.26% | 4.71% | 114 | 55.30% | 0.31 | 0.31 | 5 | +$1.27 | Reliable |
| XAUUSD | -1.41% | -1.16% | 55.52% | 112 | 48.60% | 0.30 | -0.03 | 6 | +$0.97 | 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 21% of 95 · GBPUSD: better than 35% of 95 · USDJPY: better than 68% of 95 · XAUUSD: better than 50% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 38% | +1.55% 2026-04 | -1.33% 2026-01 |
| GBPUSD | 38% | +1.26% 2025-12 | -1.85% 2026-10 |
| USDJPY | 46% | +2.81% 2026-07 | -2.16% 2026-03 |
| XAUUSD | 46% | +36.96% 2026-01 | -31.39% 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 core strategy concept combines trend identification with volatility filtering, using the Moving Average to determine price trend direction and the Standard Deviation indicator to filter out low-volatility environments. For entry conditions, the EA goes long when price is above the MA and StdDev exceeds a threshold, and goes short when price is below the MA and StdDev exceeds a threshold, ensuring trades only occur in trends with sufficient volatility support. Exit conditions rely on fixed stop-loss and take-profit levels, or on reverse MA crossover signals. Position sizing employs a fixed lot approach without dynamic adjustment based on account equity or risk percentage. Money management lacks proportional risk control and does not adapt stop-loss distances based on current volatility, creating a certain risk exposure. The overall strategy logic is clear but relatively simple, lacking adaptive capability for changing market conditions.
Strengths
- Trend following combined with volatility filtering effectively avoids frequent trading in sideways markets
- Strategy logic is simple and clear with few parameters, making it easy to understand and optimize
- Using Standard Deviation as a volatility filter is a reasonable supplementary judgment tool
Weaknesses
- Fixed lot size lacks money management mechanism, unable to dynamically adjust position based on account risk
- Missing new bar check mechanism, may repeatedly open positions on the same bar
- No spread filter, may produce unfavorable entries in high-spread environments
Possible improvements
- Add risk-based position sizing calculated as a percentage of account balance for dynamic money management
- Add new bar check and spread filter to prevent duplicate entries and unfavorable entry conditions
- Introduce trailing stop functionality to protect profits during trend continuation
Risk assessment
Overall risk: Medium
- Missing new bar check may cause multiple entries on the same bar, increasing risk exposure
- Fixed lot size does not adjust with account size, potentially over-risking small accounts
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MAPeriod | 14 | Moving average period |
MAMethod | MODE_SMA | Moving average calculation method |
MAAppliedPrice | PRICE_CLOSE | Moving average applied price type |
StdDevPeriod | 20 | Standard deviation period |
StdDevMAPeriod | 20 | Standard deviation internal MA period |
StdDevMAMethod | MODE_SMA | Standard deviation internal MA method |
StdDevAppliedPrice | PRICE_CLOSE | standard deviationapplied price type |
StdDevLevel | 0.001 | standard deviationfilter threshold |
StopLoss | 500 | Stop loss in points |
TakeProfit | 1000 | Take profit in points |
LotSize | 0.1 | Fixed lot size, used when MMRec is disabled |
MagicNumber | 123456 | EA magic number for identifying its own orders |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.