Ilan iMA
Ilan iMA is a Martingale-style grid EA that uses the iMA (Moving Average) indicator as its entry signal. When a trade goes against the position, it opens additional orders with increasing lot sizes at fixed pip intervals, aiming to recover losses on a reversal. It is a classic Ilan-family EA adapted for MQL5 with MA-based trend filtering.
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 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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: High
- Increases the position size after losses (martingale)
- Has no stop loss or trailing stop
- Can hold up to 12 positions at once
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 of this EA is the Martingale position-sizing method, which doubles the lot size after each losing trade in hopes of recovering all losses on a single winning reversal. Entry conditions are based on the iMA (Moving Average) indicator to determine the trend direction, opening the first position when price aligns with the perceived trend. If the market moves against the position, the EA opens additional orders at a fixed pip interval (Step parameter), with lot sizes multiplied by the Multiplier factor each time. Exit conditions trigger when the combined floating profit of all same-direction positions reaches the TakeProfit target, at which point all positions are closed simultaneously. Position sizing follows the classic Martingale formula: Nth level lot = Initial Lot × Multiplier^(N-1). Money management lacks a hard stop-loss, relying entirely on eventual price mean-reversion to escape drawdowns, which can lead to account blowout during strong trending markets.
Strengths
- Performs well in ranging/sideways markets, generating consistent profits
- MA trend filter reduces the probability of counter-trend initial entries
- Unified take-profit mechanism ensures all levels exit profitably together
- Highly configurable parameters allow users to adapt to different instrument characteristics
Weaknesses
- Martingale position sizing can lead to account blowout during strong trending markets
- No hard stop-loss means risk is unbounded and uncontrollable
- Margin requirements grow exponentially with each level, demanding very large account equity
- Does not account for the erosion of profit by spreads and commissions
- Drawdowns can be extreme, requiring significant psychological tolerance
Possible improvements
- Add a hard stop-loss and maximum drawdown limit to prevent account blowout
- Implement spread filter and trading session filter to avoid high-cost periods
- Consider dynamic Step based on ATR/volatility instead of fixed pip intervals for adaptive spacing
- Add a total portfolio risk percentage control to cap the maximum loss per trade series as a fraction of account equity
Risk assessment
Overall risk: Dangerous
- Martingale lot multiplication grows exponentially during consecutive losses,easily leading to margin call
- No hard stop-loss means unlimited losses in strong unidirectional markets
- No spread filter causes rapidly escalating costs when adding positions during high-volatility periods
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lot | 0.01 | Initial lot size |
Multiplier | 1.5 | martingaleposition addition multiplier |
Step | 30 | Position addition interval in points |
TakeProfit | 10 | Auto take profit in points |
MA_Period | 55 | Moving average period |
MaxTrades | 10 | Maximum position addition layers |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.