advanced extreme drawdown ~30 trades/mo

Martingale

Martingale EAs double position size after each loss so that one winner repays the whole run. A cycle ends on a win, so a near-perfect win rate is built in before any market is involved. The arithmetic decides the rest: with a 30-pip stop and target, a four-step cap and a 2-pip cost, the winner after a run of four losses does not repay it.

AIStrategyMiner EA Builder: an RSI strategy with a 30-pip stop and target wired together from blocks, the entry behind the Martingale template

At a glance

The ladder: lot size after each loss

Base lot 0.01, multiplier 2.0, Max Level 4, as in the Builder's Martingale template. Rows are losses in a row. The lot stops at the cap and stays there until a winner arrives.

The ladder: lot size after each loss Bar chart of the lot size after 0 to 6 losses in a row: 0.01, 0.02, 0.04, 0.08, then 0.16 from the fourth loss on, held at 0.16 for the fifth and sixth. 0 0.01 1 0.02 2 0.04 3 0.08 4 0.16 5 0.16 6 0.16 Held at 0.16 until a winner

At a glance

Does one winner repay the run?

Net pips after a winning trade, at a 0.01 base lot, a 30-pip stop and target and a 2-pip round-trip cost. Rows are the losing run before it. After three losses the winner only breaks even; after four it loses, and past the cap each extra loss costs far more.

Does one winner repay the run? Bar chart of the net result in pips after a winner that follows a run of losses, with a 2-pip cost: +24 after one loss, +16 after two, 0 after three, −32 after four, −544 after five and −1056 after six. 1 +24 2 +16 3 0 4 −32 5 −544 6 −1056

Mechanism

After each losing trade the EA multiplies the next position size by a fixed factor, most commonly 2.0, and re-enters. A cycle ends when a trade closes at a profit, which resets the size to base. Because the cycle is defined to end on a winner, the reported win rate is a property of the definition rather than a measurement of the rule. What varies is the depth of the ladder before the winner arrives: after k losses the next entry is 2^k times base size, so ten losses in a row call for a 1,024-times position.

Suitability

There is no market state in which the ladder is safe, only states in which it has not yet been tested. The common advice to prefer range-bound or mean-reverting symbols does not remove the risk: a pair that reverts on average still trends sometimes, and a counter-trend entry meets that trend as one unbroken losing run. A step cap bounds the loss without removing it. Appropriate only for a trader who has computed the worst-case loss in advance and can lose the account in full without consequence.

Notes

Martingale is the only common strategy that names its position-sizing rule instead of its entry. After a losing trade the EA doubles the next position, so that one winner repays every loss in the run plus the original target. The signal that opens the trade is close to incidental — an RSI extreme, a moving-average cross, a grid level — because the ladder is the product.

That makes the claim unusually easy to audit. You can write out the ladder’s arithmetic before touching market data, and add the costs it pays line by line. This page does that, then reads what the Builder’s own Martingale template and Martingale Lot block actually do — including the one behaviour of a step cap that most descriptions leave out.

How it works: the ladder is a definition, not an edge

The rule is one line. Start at base size. After a loss, multiply the next position by a fixed factor, normally 2.0. On a win, reset to base. Everything between two resets is one cycle.

The arithmetic that follows is fixed. After k consecutive losses the ladder has staked 1 + 2 + 4 + … + 2^(k−1) = 2^k − 1 units, and the next entry is 2^k units. Nine losses in a row is a 512-unit entry against 511 units already lost. Ten is a 1,024-unit entry.

Two consequences are worth separating, because descriptions of the strategy tend to blend them.

The first is that the win rate stops being a measurement. The rule defines a cycle as closing on a winner, so every completed cycle is a winning cycle. The only cycle that is not a winner is the one the account cannot finish. Quoting a martingale’s cycle win rate is quoting the definition back.

The second is that the smoothness is real, not an artefact. Small, frequent recoveries accumulate while the ladder stays shallow, so almost all of the distribution sits in one place and the rest in a tail that arrives once. This is the same shape as a grid EA without a basket stop, and for the same reason: both answer an adverse move by adding exposure rather than realising a loss.

What separates them is where the risk is set. Grid spacing decides how often the ladder deepens; the multiplier decides how much each step costs. An EA that does both is not a grid with a feature — it is a martingale with a schedule.

The multiplier the ladder would actually need

There is a failure that arrives before ruin, and it is rarely stated: a doubling ladder does not always repay the run it was built for.

The condition is arithmetic. After k losses the ladder has staked 2^k − 1 units of average loss, and the recovery entry of 2^k units returns 2^k × payoff. So the recovery repays the run only when the payoff ratio — average win divided by average loss — clears 0.5 at the first step, 0.75 at the second, 0.875 at the third, and approaches 1.0 as the run lengthens. Doubling is the right multiplier only for a rule whose average win already matches its average loss.

Cost moves every one of those thresholds, because the broker charges it on the scaled position. Take the Builder’s Martingale template: a 30-pip stop and a 30-pip target, so the payoff is exactly 1.0 before cost. Add a 2-pip round trip and each winner nets 28 while each loser costs 32 — an effective payoff of 0.875. That clears the first two thresholds, sits exactly on the third, and fails from the fourth.

The uncomfortable pattern underneath is that martingale is drawn to high-win-rate rules. High win rates come from targets placed close to the stop or closer, which is exactly the arrangement that leaves the recovery trade too small.

What the Builder’s Martingale template and block do

The Builder ships one Martingale template: an RSI 14 entry that buys below 25 and sells above 75, a 30-pip stop and target, and a Martingale Lot block set to a 0.01 base, a 2.0 multiplier and a Max Level of 4. The gallery does not mark it as recommended. It reserves its “recommended” badge for templates with single-shot entries, a fixed stop and target on every entry, and no martingale, averaging-down, pyramiding or reversal blocks.

Two behaviours of the block matter more than its defaults.

The level is the losing run, and it stops at the cap without resetting. The compiled EA counts consecutive losing trades on the symbol and magic number from the trade history, every tick, and caps that count at Max Level. So the lot climbs 0.01 → 0.02 → 0.04 → 0.08 → 0.16 and then stays at 0.16 until a winner. It does not fall back to base. A cap is therefore not a stop on the ladder; it converts the tail of the ladder into flat betting at the largest size.

The drawdown halt freezes the EA; it does not close anything. The block’s Halt at drawdown (%) input (30 by default) compares account equity with its peak. When the gap reaches the threshold, the EA leaves every tick early. It opens no trades, and the blocks that run after that check — Account Guard, Close All, Basket Average TP, averaging down — are not evaluated either. Stops and targets already at the broker stay, and trailing or break-even exits keep running. The EA stores the peak in a terminal global variable, so a restart does not reset it.

Here is what that means for a single losing run at the template’s settings, in pips at the 0.01 base lot, if the next trade after the run wins:

Losing runLot on the recovery tradeNet after the win, no costNet after the win, 2-pip cost
10.02+30+24
20.04+30+16
30.08+300
40.16+30−32
50.16 (capped)−450−544
60.16 (capped)−930−1,056

Without cost, the capped ladder repays every run up to four and fails from the fifth. With a 2-pip cost it fails a step earlier. Below the cap, the payoff is a fixed +30; above it, the loss grows by 480 to 512 base-lot pips for every extra loss.

Test conditions
SourceBaseline printed on the Martingale template card in the EA Builder
Symbol / timeframeUSD/JPY M5 (Exness MT5, re-measured on 2026-09-19 after a fix, fixed 20-point spread, 72% history quality)
Period2025-06-01 – 2026-06-09
ModelM1 OHLC (bar-level, not real ticks)
Deposit / inputs10,000, template defaults, no optimisation

At stock settings the template scored a profit factor of 0.85 over 646 trades, a −4.71% drawdown and a net result of −363.54. In our own stock-settings baseline of the Builder’s templates — a single USD/JPY M5 run over one year, default inputs, no optimisation — most finished below a 1.0 profit factor, and the ladder did not lift this one above it.

0.16Top lot at 0.01 base, ×2, Max Level 4 — held until a winner
4 lossesRun a 2-pip cost stops the 30/30 ladder from repaying
0.85Martingale template profit factor at stock settings

Market conditions: what the ladder needs and never gets

ConditionLadder survivesLadder fails
Losing runsShort and interrupted by winnersOne sustained move the rule re-enters into
Payoff ratioAt least 1.0 after cost, so a recovery repays the runBelow 1.0 — the winner cannot clear the stake
Position sizingLadder top fits inside free margin and the symbol’s volume limitRecovery entry is unfundable or unplaceable
Test periodContains the worst run the symbol can produceEnds before the run arrives
Cost modelSlippage and swap charged on every scaled entryFixed average spread, financing ignored

The common advice is to run martingale on range-bound or mean-reverting symbols, since price returns and the recovery arrives. It misreads the risk. A symbol that reverts on average still trends occasionally, and a counter-trend entry meets that trend as one unbroken losing run — the same move beats every re-entry. The ladder only needs the exception.

The honest framing is that no market state makes the ladder safe. There are states in which it has not yet been tested, and a test period that ends before the worst run arrives will report exactly that.

Parameters and settings in MT5

In the Builder these are blocks with their own inputs, and every value becomes an input in the compiled EA.

Block and inputWhere the risk sitsWhat it controls
Martingale Lot MultiplierAny value above 1.0Cost of each step; 2.0 is standard and too small for a payoff under 1.0 after cost
Martingale Lot Max LevelMust be finite, 1–10Caps the ladder; losses past it are taken at the top lot
Martingale Lot Halt at drawdown (%)Freezes the EA, closes nothingStops new trades — and the checks after it — at a drawdown from peak equity
Averaging Down Max Additions / Interval (pips) / Lot MultiplierA multiplier above 1.0 is a martingaleHow quickly a move deepens a basket, and how expensive each add is
Basket Average TPNet across open legsCloses the basket at the weighted-average price plus N pips
Account Guard Floating loss cap (% of balance)The real circuit breaker, if it trips firstCloses this EA’s positions when the account’s floating loss reaches N% of balance, then pauses
Spread Filter Max Spread (points)Just above normal spreadBlocks the scaled entries that arrive in the worst conditions

Three MT5 realities decide whether the ladder behaves as designed:

  • The recovery order can simply be refused. Position size is bounded by SYMBOL_VOLUME_MAX and quantised by SYMBOL_VOLUME_STEP. The EA the Builder generates clamps an oversized lot to the maximum and rounds it to the step before sending, and a clamped recovery cannot repay the run it was sized for. Check the ladder top against both before anything else.
  • Stop-out happens on margin level, not on equity. ACCOUNT_MARGIN_LEVEL falling through the broker’s stop-out threshold closes positions, and a margin call arrives before equity reaches zero. Negative balance protection decides whether the damage stops at zero.
  • Backtest fidelity matters more here than for any other strategy. The whole record depends on a handful of deep-ladder trades. Run real tick data, read the modelling quality, and treat a result built on 1-minute OHLC as a first read only.
  1. Build the entry with a Fixed Lot block first and measure it. Record its payoff ratio and its worst losing run — those two numbers, not the win rate, decide the ladder.
  2. Compute the ladder top: base lot × multiplier raised to Max Level. Check it against SYMBOL_VOLUME_MAX and your free margin.
  3. Compare the payoff after cost with the thresholds above, and reject the multiplier if a recovery cannot repay the run.
  4. Swap in the Martingale Lot block and add an Account Guard set well below the halt threshold, so the tester realises the loss before the halt freezes the guard.
  5. Extend the test until it contains at least one sustained move against the entry logic. If it does not, the result is untested rather than robust.

Failure modes: how a martingale EA ends

  • The run outlasts the account. The dominant path. Losses arrive in a block because the same conditions that beat one entry beat the next.
  • The step cap converts ruin into flat betting at the top size. In the Builder’s block the lot holds at the cap rather than resetting, so every loss past the cap is the largest loss in the ladder, and none of them is repaid.
  • The recovery is too small to recover. A payoff below 1.0 after cost means the ladder is undersized at its own arithmetic, before any market view enters.
  • Costs are charged on the scaled position. Slippage, spread and swap all scale with the ladder, so the deep entries — the ones the whole strategy depends on — are the most expensive trades in the record.
  • The halt is mistaken for a stop. A drawdown halt leaves open positions running, and once it fires the Account Guard stops being evaluated. Only a guard that trips before the halt realises the loss at a chosen level.
  • The backtest ends before the run. A test period without a sustained adverse move reports the performance of a ladder that has not yet been tested.

How to test a martingale EA in AIStrategyMiner before it costs anything

The useful test is not whether a martingale EA makes money — over most samples it will. It is whether the ladder it needs fits inside the account you would fund. That takes two numbers from the entry alone: its worst losing run and its payoff ratio after cost.

  • Build the entry signal at a Fixed Lot and press Measure; read the worst losing run and payoff before adding any ladder.
  • Write out the ladder table above for your own stop, target, cost and Max Level, and find the run length at which the winner stops repaying.
  • Replace the Fixed Lot with the Martingale Lot block and compare the two results on the same data, with an Account Guard set below the halt.
  • Confirm in the MT5 Strategy Tester on real ticks over a period containing a sustained adverse move.

The .ex5 compiled from your own flow is free. The .mq5 source is part of Pro, a one-off purchase with no subscription — see pricing if you want to read how the generated ladder counts its levels. The site’s methodology sets out how backtest results should be read.

Martingale versus grid

MartingaleGrid
What sets position sizeThe previous trade’s outcomeFixed at every level
What it needs to workA winner before the ladder outruns the accountOscillation through the same levels
Exposure growthExponential in the losing runLinear in the level count
Reported win rateFixed by the cycle definitionHigh, from small per-basket targets
Worst caseFull loss of the accountFull loss of the account, reached more slowly
The input to read firstMultiplierMax Additions and the basket stop

The two are often presented as different products and are frequently the same one. A grid with a lot multiplier above 1.0 is a martingale whose step distance is set by the spacing, and it inherits the exponential exposure without the grid’s linear worst case. The trend-following contrast is starker: a trend EA’s bad period is a long series of ordinary losses that leaves the account intact. A martingale’s bad period is one run, and patience does not survive it. Read the multiplier before the equity curve, on every EA that has one.

Measure the ladder your signal would need

Build the entry at a fixed lot first and read its worst losing run and payoff. Then compare it with the Martingale Lot block on the same data, with an Account Guard set below the halt, before any capital is involved.

  • Compile a standard .ex5 file for MetaTrader 5 and test it on real ticks over a period that contains a sustained move against the entry.

Check the finished EA in MetaTrader 5 before you trust it. The numbers on this page come from what you typed; they are not a forecast of results.

AIStrategyMiner EA Builder: strategy blocks wired together on a canvas, with the properties panel on the right

Typical pairs

Where this strategy works best

Related articles

Frequently asked questions

What is a martingale EA?
A martingale EA is an expert advisor that sets position size from the outcome of the previous trade rather than from the setup. After each loss it multiplies the next position by a fixed factor, usually 2.0, and it returns to base size as soon as a trade closes at a profit. The entry logic can be anything — an RSI extreme, a moving-average cross, a grid level — because the ladder is the part doing the work. That is also why it is easy to audit: the ladder's arithmetic can be written out before any test is run.
Does a martingale EA really have a high win rate?
It has a high cycle win rate by construction, which is a different thing. A martingale cycle is defined to end when a trade closes at a profit, so every completed cycle is a winning cycle unless the account runs out first. A number that is fixed before the test is run carries no information about the rule. Read the underlying trade win rate, the payoff ratio and the worst losing run instead.
How many doubling steps should a martingale EA allow?
No step count makes the ladder safe. A cap bounds the size of the loss; it does not remove it. In the Builder's Martingale Lot block, the level is the number of consecutive losses counted from the trade history, and it stops rising at Max Level — the lot then stays at the top step until a winner arrives. With a 0.01 base, a 2.0 multiplier and a cap of 4, the top lot is 0.16, and every loss beyond the fourth is taken at 0.16 without the ladder repaying it. Choose the cap from a worst-case loss you have computed, not from a round number.
Can a martingale EA recover its losses?
Only if the average win is large enough after costs. After k losses the ladder has staked 2^k − 1 units and the recovery entry is 2^k units, so the winner repays the run only when the payoff ratio clears roughly 0.5 at the first step, 0.75 at the second, 0.875 at the third, and approaches 1.0 as the run lengthens. Cost pushes those thresholds up, because it is charged on every scaled entry. At a 30-pip stop and target with a 2-pip round-trip cost, a winner after three losses only breaks even, and after four it loses.
Is martingale safer on range-bound or mean-reverting pairs?
Not in the way the advice implies. A reverting pair gives the ladder more short runs, which makes the curve smoother, but the outcome is decided by the longest losing run the symbol can produce. A counter-trend entry meets a trending phase as one continuous block of losses, because the same move that beat one entry beats the next. No pair label tells you how long that block can be; only a long test containing a sustained move against the entry does.
How is martingale different from grid trading?
A pure grid places orders at fixed intervals in constant size and profits from oscillation; a martingale changes size in response to losses. The two are often combined, and the combination is where most account failures come from, because grid spacing decides how fast the ladder deepens while the multiplier decides how expensive each step is. If an EA exposes a lot-multiplier input above 1.0, it is a martingale regardless of what it is called. Read that input before the equity curve.