Martingale and grid strategies: the risk math backtests hide

5 min readMetaKit

Martingale and grid EAs sell themselves with the best-looking equity curves in forex: a smooth line going up and to the right, month after month, with a win rate in the 90s. Then, one day, the line drops to near zero in an afternoon. Both halves of that story come from the same math. Here it is.

Martingale: double after every loss

The classic martingale doubles the position after a loss, so a single win recovers every previous loss plus the original profit target.

Start at 0.01 lots with a symmetric stop and target worth $10 each (100 pips on EURUSD at 0.01 lots):

Losses in a rowTotal lost so farNext lotNext trade risks
0$00.01$10
1$100.02$20
3$700.08$80
5$3100.32$320
8$2,5502.56$2,560
10$10,23010.24$10,240

After n losses you've lost base × (2ⁿ − 1), and the next trade is base × 2ⁿ. The bet grows exponentially; the target profit stays at $10.

The probability that ends it

With a 50% chance of winning each trade, the chance of ten losses in a row is (0.5)¹⁰ = 1 in 1,024. That sounds safe. It isn't, because you don't run one sequence, you run hundreds.

  • Over 100 sequences, the chance of hitting a ten-loss streak at least once is 1 − (1023/1024)¹⁰⁰ ≈ 9%.
  • Over 1,000 sequences, it's ≈ 62%.
  • Over 3,000 sequences, it's ≈ 95%.

And real win rates are below 50% once you include spread. Worse, losing trades aren't independent coin flips: in a strong trend, the same direction keeps losing for the same reason, so long streaks are more likely than the coin math says.

When the streak comes, one of two things stops the sequence: your margin runs out and the broker's stop-out closes everything, or the next lot exceeds the symbol's volume_max. Either way, the account takes the full accumulated loss. A strategy that made $10 a trade for a year gives it all back in one sequence.

Grid: averaging into a losing position

A grid strategy places orders at fixed intervals. A typical "averaging" grid buys more every time price falls by a set distance, and closes everything when price recovers to a profit target on the combined position.

Buy 0.10 lots every 20 pips as EURUSD falls:

Positions openPrice fallFloating lossLots open
10 pips$00.10
340 pips$600.30
580 pips$2000.50
10180 pips$9001.00
20380 pips$3,8002.00

With n positions spaced d pips apart, the floating loss is about lot × pip value × d × n(n − 1) ÷ 2. It grows with the square of the move, not linearly. A 200-pip trend against a grid isn't twice as bad as 100 pips; it's roughly four times as bad. Many grids also multiply the lot at each level, which turns the quadratic into a martingale.

Grids work beautifully in ranges, which is most of the time, and that's exactly why they're dangerous: they're paid small, frequently, to absorb a large loss rarely. Traders call it "picking up pennies in front of a steamroller".

Why the backtests look so good

  • The blow-up is rare by design. A backtest over two quiet years may contain no streak long enough to break it. The strategy hasn't been proven; it hasn't been tested.
  • Win rate looks fantastic. 95% winning trades is normal for these strategies. It says nothing about the size of the 5%.
  • Floating drawdown is hidden. A grid that's down $3,800 on open positions but hasn't closed any of them shows a clean closed-trade history. Look at the equity curve, not the balance curve.
  • Backtest spreads and slippage are optimistic, and stop-outs in fast markets fill worse than modelled. The MT5 backtesting post covers which tester settings make this less wrong.

The honest way to read any of these results is maximum drawdown on equity against profit. If the worst floating drawdown was 70% of the account, the strategy is one bad week from a margin call, however many green months there were. The Sharpe and max drawdown post shows how to compute both properly.

Is martingale ever profitable?

It can be profitable for a long time, which is different from having an edge. Doubling doesn't change the expected value of the trades; it rearranges the outcomes into many small wins and a few catastrophic losses. If the underlying trades have no edge, martingale doesn't create one. If they do have one, you'd make more with less risk by sizing normally.

The anti-martingale does the opposite, increasing size after wins and cutting it after losses. It has the opposite profile: many small losses, occasional large wins, and no single sequence that can wipe out the account. Most professional position sizing, including the Kelly criterion, is closer to anti-martingale than martingale.

If you're going to run one anyway

Plenty of traders run grid and martingale EAs knowing all of the above. If you do, put a hard limit outside the EA, because the EA's own logic is the thing that fails:

  1. Decide the maximum equity drawdown you'll accept, say 25%, and treat hitting it as "the strategy failed", not "it'll come back".
  2. Monitor equity, not balance, continuously, even when you're not at the screen.
  3. Close everything when the limit is hit, automatically.

With an account on MetaKit, an equity monitor covers steps 1 and 2: a drawdown monitor fires when equity falls a set percentage from its peak since arming, and alerts you on Telegram, Slack, Discord or a webhook. For step 3, point the webhook at a small handler that closes every open position on that account through the trading API: DELETE each ticket from /positions. The monitor watches from the cloud, so it keeps working when your laptop and your VPS don't.

That turns an unbounded loss into a bounded one. It doesn't make the strategy good; it makes the worst case a number you chose.