MartingalePulse
A multi-strategy Expert Advisor that combines four price action entry methods (HFT tick momentum, engulfing candlestick, RSI reversal, EMA crossover) with a Martingale position sizing system. It features advanced risk management including daily profit/drawdown limits, trading session filters, trailing stops, and margin checks. The EA increases lot size after losses using configurable Martingale types and resets on profit or when the maximum order count per round is reached.
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.18% | -0.15% | 5.08% | 123 | 50.00% | -0.01 | -0.04 | 5 | −$0.08 | Reliable |
| GBPUSD | +5.66% | +4.90% | 4.64% | 121 | 58.30% | 0.94 | 1.22 | 4 | +$4.91 | Reliable |
| USDJPY | +0.79% | +0.68% | 4.47% | 122 | 45.90% | 0.17 | 0.18 | 7 | +$0.65 | Reliable |
| XAUUSD | +129.66% | +98.76% | 25.64% | 129 | 52.30% | 1.58 | 5.06 | 5 | +$103.23 | Reliable |
Profitable on 3 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 69% of 16 · GBPUSD: better than 87% of 15 · USDJPY: better than 38% of 16 · XAUUSD: better than 94% of 16
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +2.00% 2026-02 | -1.67% 2026-06 |
| GBPUSD | 69% | +2.83% 2026-02 | -2.75% 2026-03 |
| USDJPY | 62% | +2.82% 2026-05 | -3.27% 2026-08 |
| XAUUSD | 69% | +26.27% 2026-02 | -15.77% 2026-08 |
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 core strategy concept combines technical analysis entry signals with a Martingale money management system. Entry conditions offer four options: HFT tick momentum requires N consecutive ticks moving in the same direction; engulfing pattern requires the previous candle to be fully engulfed by the current one; RSI reversal requires RSI crossing back from overbought/oversold zones; EMA crossover requires the close price crossing the EMA line. Exit conditions rely on a fixed-point stop loss and a take profit calculated from the risk-reward ratio, with an optional trailing stop. Position sizing uses a Martingale approach that increases lot size after losses via three modes—classic multiplier, multiplier plus initial lot, or additive increment—and resets on profit. Money management supports fixed lot sizing or risk-percentage-based initial lot calculation, with daily profit caps and drawdown protection. The EA also supports three entry methods—market orders, stop orders, and limit orders—and trading session control configurable per day of the week.
Strengths
- Offers four different entry strategy options, providing good flexibility
- Includes daily profit cap and drawdown protection, showing risk awareness
- Supports trading session filtering to avoid unfavorable time periods
- Martingale rounds have a maximum order count limit, preventing infinite doubling
- Well-structured code with good modularity and margin sufficiency checks
Weaknesses
- Martingale strategy is inherently high-risk; lot sizes grow exponentially during losing streaks, rapidly draining the account
- Market orders are placed without SL/TP first then modified, risking naked positions if modification fails due to slippage
- EMA crossover and some strategies lack new-bar checks, potentially triggering repeated signals on the same bar
- No spread filter is implemented, which can cause losses during high-spread periods especially on smaller timeframes
- Reversal logic closes the current position and waits for the next tick to open a new one, potentially missing optimal entry prices in fast markets
Possible improvements
- Add direct SL/TP setting for market order entries to avoid the risk window of opening then modifying
- Implement consistent new-bar checks across all entry strategies to prevent repeated signals on the same bar
- Add a spread filter to pause entries when spread exceeds a configurable threshold
- Consider adding a total monetary loss limit for Martingale cycles, complementing the order count limit with a capital dimension
- Improve reversal logic to open the opposite position immediately after close confirmation instead of waiting for the next tick
Risk assessment
Overall risk: Dangerous
- Martingale strategy causes exponential lot size growth during consecutive losses, potentially leading to account blowout
- Market orders are opened first then SL/TP is set via modification, risking unprotected positions if modification fails
- Default Martingale multiplier of 2.0 with 5 rounds maximum can reach 32x the initial lot size in extreme cases
- No spread filter means entries during high-spread periods can generate unnecessary losses
- Waiting for the next tick after reversal close may result in worse entry prices during volatile markets
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpPriceActionType | EMA_CROSSOVER | Price action strategy type |
InpEntryStrategy | MARKET_ORDER | Entry strategy (Market/Stop/Limit) |
InpPendingOrderDistancePoints | 500 | Pending order distance in points from current price |
InpPendingUpdateInterval | 100 | Pending order update interval in seconds |
InpTradeCooldownSeconds | 3 | Trade cooldown in seconds |
InpChartTimeframe | PERIOD_CURRENT | Indicator timeframe |
InpTickMomentumCount | 6 | Consecutive ticks required for HFT momentum |
InpEmaPeriod | 15 | EMA period |
InpRsiPeriod | 14 | RSI period |
InpRsiOverbought | 70 | RSI overbought level |
InpRsiOversold | 30 | RSI oversold level |
InpLotSizeMode | PERCENT_OF_BALANCE | Lot size mode (Fixed/Risk Percentage) |
InpFixedInitialLot | 0.01 | Fixed initiallot size |
InpRiskPercentage | 1.0 | Balance risk percentage |
InpMartingaleType | CLASSIC_MULTIPLIER | martingale type |
InpMartingaleMultiplier | 2.0 | Martingale multiplier |
InpMaxOrdersPerRound | 5 | Max orders per Martingale round |
InpMaxLotSize | 5.0 | Maximum lot size limit |
InpStopLossPoints | 1000 | Stop loss in points (required in risk management mode) |
InpRiskRewardRatio | 2 | Risk-reward ratio |
InpEnableTrailingStop | false | Enable trailing stop |
InpTrailingStopType | TRAILING_IN_POINTS | Trailing stop type (Points/Money) |
InpTrailingStartPoints | 200 | Trailing stop activation in points |
InpTrailingStopPoints | 100 | Trailing stop distance in points |
InpTrailingStartMoney | 50 | Trailing stop activation amount in money |
InpTrailingStopMoney | 10 | Trailing stop distance in money |
InpEnableTradingSessions | true | Enable trading sessions |
InpCloseAtSessionEnd | true | Close positions at session end |
InpMondayTimes | 01:00-23:00 | Monday trading hours |
InpEnableDailyProfitLimit | true | Enable daily profit limit |
InpDailyProfitLimitAmount | 1000.0 | Daily profit limit amount |
InpEnableDrawdown | true | Enable drawdown protection |
InpDrawdownType | PERCENTAGE | Drawdown calculation type (Fixed/Percentage) |
InpDrawdownFixedAmount | 300.0 | Maximum drawdown fixed amount |
InpDrawdownPercentage | 5.0 | Maximum drawdown percentage |
InpDrawdownTimeMode | SERVER_TIME | drawdowncalculationtime mode |
InpMagicNumber | 105091 | EA unique identifier number |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.