Martin
This EA implements a classic Martingale strategy, doubling the lot size after each losing trade while resetting to the initial lot after a win. It opens positions based on a simple signal (typically a single indicator or price action condition) and relies on the Martingale progression to recover losses through increasingly larger positions.
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 | -2.46% | -2.14% | 4.76% | 122 | 49.60% | -0.52 | -0.52 | 7 | −$1.75 | Reliable |
| GBPUSD | +0.50% | +0.44% | 6.10% | 121 | 51.70% | 0.12 | 0.08 | 6 | +$0.62 | Reliable |
| USDJPY | -0.64% | -0.55% | 7.30% | 121 | 52.90% | -0.09 | -0.09 | 9 | −$0.52 | Reliable |
| XAUUSD | -79.45% | -72.95% | 93.99% | 119 | 46.60% | -0.60 | -0.84 | 6 | −$65.23 | 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 Martingale EAs with a reliable result on the same market: EURUSD: better than 31% of 16 · GBPUSD: better than 40% of 15 · USDJPY: better than 25% of 16 · XAUUSD: better than 0% of 16
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +1.71% 2026-03 | -1.90% 2026-06 |
| GBPUSD | 54% | +2.13% 2026-02 | -2.39% 2026-07 |
| USDJPY | 46% | +2.30% 2026-04 | -2.71% 2026-01 |
| XAUUSD | 46% | +62.08% 2026-11 | -57.43% 2026-10 |
From the backtest equity curve, sampled about every two days; only reliable results.
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 is based on the classic Martingale theory: doubling the bet after each loss so that a single win can recover all previous losses. Entry conditions typically rely on a single technical indicator signal (such as moving average crossover or RSI overbought/oversold) to determine trade direction. Exit conditions close the position when a take-profit target is reached, while a loss triggers a doubled lot size on the next trade. Position sizing follows a geometric progression, multiplying the lot by a coefficient (typically 2) after each loss, and resetting to the initial lot after a win. Money management lacks a hard stop-loss, meaning account risk grows exponentially with consecutive losses, potentially leading to a margin call under extreme market conditions. The strategy may appear effective in ranging markets short-term but carries enormous risk during sustained trending moves.
Strengths
- Simple and easy-to-understand logic, accessible even for beginners
- May perform well short-term in ranging/sideways markets, generating consistent small profits
- Automatically resets lot size after a win, locking in profits and avoiding over-leveraging
Weaknesses
- Lot size grows exponentially during consecutive losses,easily leading to margin call
- Lacks effective stop-loss mechanism, losses are uncapped in trending markets
- Poorly suited for trending markets, adding to losing positions amplifies losses
- Does not account for the erosion effect of spreads and commissions on the Martingale sequence
Possible improvements
- Add a maximum consecutive loss count limit and a hard cap on maximum lot size to prevent unlimited position scaling
- Introduce a hard stop-loss and account risk percentage control to protect capital
- Incorporate a trend filter indicator to avoid adding positions against strong trending markets
Risk assessment
Overall risk: Dangerous
- Martingale lot doubling causes exponential position growth during losing streaks, potentially wiping out the account
- No hard stop-loss protection means uncapped losses in extreme market conditions
- No hard cap on maximum position size leaves risk exposure uncontrolled
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.01 | Initial lot size |
LotMultiplier | 2.0 | Hedge position lot multiplier |
TakeProfit | 500 | Auto take profit in points; 0=disabled |
StopLoss | 0 | Auto stop loss in points; 0=disabled |
MaxLots | 0 | Maximum lot size limit (0=unlimited) |
MagicNumber | 12345 | Unique EA order identifier preventing conflicts |
SignalPeriod | 14 | TRIX signal line moving average period |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.