Home Free Tools Trading Guides Blog Pricing FAQ 🔐 Customer Login

Grid and Martingale EAs: How They Work and the Risks

Grid and martingale EAs are popular because their backtests often look smooth. Here is how they work, with a worked gold example, and the risks that the smooth curve can hide.

Grid and Martingale EAs: How They Work and the Risks

Key takeaways

  • Martingale increases the position size after each loss, so risk grows much faster than the potential profit.
  • Grid systems add positions as price moves against them, so one strong trend can create a very large floating loss.
  • Both styles can show many small wins and then one very large loss, which a normal backtest summary can hide.
  • Before running one, check the worst drawdown, the largest position it can open, and whether it has a hard stop.

In this article

What a martingale EA does

A martingale system increases the size of the next trade after a loss. The idea is that one eventual winner will recover all earlier losses and leave a small profit. Investopedia and broker education pages describe the same weakness: the amount you risk grows quickly, while the profit on a win stays small.

It sounds sensible when you picture a coin flip. In real markets there are limits that the idea ignores: your account balance, the broker's maximum lot size, and the spread and commission paid on every trade.

A worked example on gold

Take hypothetical numbers: gold with a 100 oz lot, a fixed $5 stop and a $5 target, starting at 0.01 lots and doubling after every loss.

TradeLot sizeLoss if stopped outTotal lost if every trade so far lost
10.01$5$5
20.02$10$15
30.04$20$35
40.08$40$75
50.16$80$155
60.32$160$315
70.64$320$635
81.28$640$1,275

If trade 8 wins, it earns $640, which repays the $635 lost on trades 1 to 7 and leaves a net gain of just $5. If it loses as well, the total loss is $1,275. Trade 1 risked $5. Trade 8 risks $640, which is 128 times more, for the same $5 net gain.

Margin also grows. At a hypothetical gold price of $4,000 and 1:100 leverage, a 1.28 lot position needs about $5,120 of margin. See our margin and leverage guide for the formula.

What a grid EA does

A grid EA places orders at fixed price steps, for example every $2 on gold. It often adds a new position each time price moves further against the basket, then closes the whole basket when it reaches a small combined profit. In a choppy, ranging market this can win very often, because price keeps returning to the average level.

The danger is a strong one-way trend. The basket keeps adding positions while the floating loss grows. Some grid EAs combine this with martingale lot sizing, which makes the loss grow even faster.

Why the backtest can look so smooth

Both styles tend to produce many small wins and rare, very large losses. A backtest summary that shows a high win rate and a steady curve can hide the one period where the system was exposed to a huge floating loss. If the historical data did not include a trend strong enough to break it, the test simply never met the danger.

That is why the numbers to read first are maximum drawdown, the worst floating loss, and the largest lot size the EA opened during the test. Our guide to drawdown explains how to read them.

Risks that matter for real accounts

For context, European regulators report that between 74% and 89% of retail CFD accounts lose money, which is why high-risk position sizing deserves extra caution.

Questions to ask before running one

You can estimate how likely a loss limit is to be hit with our risk of ruin simulator, and size trades from your risk with the gold lot size calculator.

Frequently asked questions

Are grid and martingale EAs illegal?

No. They are legal strategies, but they carry high risk because exposure can grow quickly. Some brokers and prop firms restrict certain styles, so check the rules of the account you use.

Why do some grid EAs show such a high win rate?

Because they close baskets for small profits most of the time, and a few large losing periods are rare. A high win rate on its own says nothing about how large the occasional loss can be.

Is a fixed stop loss safer than a grid?

A fixed stop loss limits the loss on each trade to an amount you choose in advance, which makes the worst case easier to know. It does not remove risk. It can still be hit repeatedly, which is why position sizing matters.

Free tools mentioned in this article

Related guides: Margin and leverage explained, What is drawdown?, Position sizing guide.

Sources

Sources checked on 2 November 2026. Rules and figures from third parties can change, so check the original before relying on them.

More from the blog

Want to test an EA on your own platform?

Gold Rush Algo is an MT5 Expert Advisor for XAUUSD. Download the free backtest version and judge it with your own numbers before deciding anything.

Disclaimer: This article is for educational purposes only and is not financial advice. Examples use hypothetical numbers and past or simulated results do not guarantee future results. Trading leveraged products carries a high risk of loss and is not suitable for everyone. See our full risk disclaimer.