Martin for small deposits
A Martingale-style EA that opens positions in one direction and progressively increases lot size by a multiplicative factor when price moves against the position. It uses a simple price comparison over 15 bars to determine initial direction, then adds positions at fixed step distances. All positions are closed when total floating profit exceeds a threshold, or immediately if both buy and sell positions somehow coexist.
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 999 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
This EA implements a classic Martingale strategy where the core concept is to progressively increase position size when price moves against existing positions to average down the entry price. Entry conditions come in two types: the initial entry direction is determined by comparing the close price of the most recent bar against the close 15 bars ago (lower close triggers buy, higher triggers sell); subsequent entries occur when price moves against existing positions by more than the configured step distance, with lot size multiplied by the increase factor raised to the power of the position count. Exit conditions are solely based on total floating profit across all positions exceeding the minimum profit threshold, with absolutely no stop loss mechanism. Position sizing follows exponential growth where the N-th additional position uses the base lot multiplied by the increase factor to the N-th power, capped by a maximum lot limit. Money management is severely deficient: there is no stop loss, the strategy relies entirely on price reversion to exit profitably, and sustained trending markets can lead to margin call due to continuously increasing exposure. The bar-skipping mechanism limits adding frequency but does not effectively control downside risk.
Strengths
- Simple and clear logic with well-structured code that is easy to understand and modify
- Maximum lot size cap provides some constraint against extreme position accumulation
- Safety mechanism that closes all positions if both buy and sell positions coexist unexpectedly
- Uses actual floating profit including commissions and swaps rather than just price distance for exit decisions
Weaknesses
- No stop loss mechanism whatsoever, positions can accumulate indefinitely in a trending market leading to margin call
- Martingale strategy is inherently high-risk with exponentially growing exposure when losing, requiring geometric capital growth
- Entry signal is overly simplistic (just comparing close of bar 1 vs bar 15), lacking proper technical analysis confirmation
- Lot size check uses strict less-than instead of less-than-or-equal, preventing opening when calculated lot exactly equals InpMaxLot
- Bar-skipping calculation relies on CopyOpen which may produce inaccurate counts due to data availability issues
Possible improvements
- Add stop loss mechanisms such as account maximum drawdown percentage or per-position maximum loss as hard stops
- Improve entry signals with trend indicator confirmation (e.g., MA direction, RSI overbought/oversold) to avoid adding against strong trends
- Fix lot size upper bound check by changing lot<InpMaxLot to lot<=InpMaxLot to allow opening when lot exactly equals the maximum
- Add maximum position count limit and maximum total lot limit to prevent unlimited position accumulation
Risk assessment
Overall risk: Dangerous
- Martingale strategy with no stop loss causes exponential position growth in trending markets,easilyleading to margin call
- No maximum drawdown protection or account equity safeguard mechanism exists
- Very weak entry signal may cause persistent counter-trend position accumulation
- Bar-skipping mechanism may fail during data anomalies, causing uncontrolled adding frequency
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpLots | 0.01 | Fixed lot size value |
InpTakeProfit | 65 | Take profit in points |
InpStep | 15 | Position adding interval in points |
InpBarsSkipped | 45 | Number of bars skipped, controls position adding frequency |
InpIncreaseFactor | 1.7 | Lot increment multiplier factor for additional positions |
InpMaxLot | 6.0 | Maximum allowed lot size |
InpMinProfit | 10.0 | Minimum profit threshold; close all when reached |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.