Automated trading8 min read
Grid and martingale EAs: how they work and why they can blow up
Grid and martingale EAs can look smooth for months, then take a large loss in one move. How exposure grows, what margin calls mean and how to read a backtest honestly.

Grid and martingale EAs add to a losing position. That is where martingale EA risk comes from: a move against you can grow total exposure far faster than the first trade suggests. A grid EA opens new trades at set price steps, and a martingale EA increases the size of each new trade, often after a loss. Together, they can recover from small pullbacks, but they can also turn a normal trend into a large drawdown or a margin call.
Not every grid EA fails, and none is safe by default. The risk depends on the grid step, size multiplier, maximum levels, stop rules, pair, leverage and account size.
Why the first trade size tells you little
A normal position has a known size and stop distance, so its maximum loss can be estimated before entry. A grid or martingale system changes that picture, because the loss depends on how many levels are opened and how large each level becomes. The first trade may risk a small amount, but a later trade in the same basket can be many times larger.
All the trades in a basket point the same way, and that is the core risk. If price moves sideways or retraces, the basket can close with a small gain. If price trends without a useful retracement, each new level adds exposure to the losing side, while margin use rises and free margin falls. A trader who only looks at the first trade size will understate this risk.
How grids and martingale sizing work
A grid is a set of price levels spaced by a fixed distance. For a buy grid, the EA opens a buy at each level as price falls. For a sell grid, it opens a sell at each level as price rises. The distance between levels is called the grid step, usually measured in pips or points. The basket is the group of open trades, often closed together when price returns to a target.
Grid trading without a size increase
An equal-size grid still adds exposure, but the growth is steady rather than accelerating. For example, five levels of 0.10 lots give a total of 0.50 lots. This version can still face a large drawdown in a trend.
Martingale sizing after a loss
A martingale system increases size after a loss, or at each new grid level, by a multiplier. A multiplier of 2.0 doubles the size each time, while a multiplier of 1.5 increases it by half each time. The problem is that size grows quickly, and after only a few levels the latest trade can be larger than all earlier trades combined.
Why the equity curve can look smooth
A grid or martingale EA can produce a rising curve for a long time in ranging markets. Many baskets close with small gains, losing baskets are held rather than closed, and the account balance may rise while open drawdown is hidden in floating losses. The fuller picture appears only when you look at equity, which includes floating profit and loss.
A backtest or statement that shows balance alone can therefore mislead. A system can close dozens of small winning baskets while one large basket stays open at a growing loss. When that basket finally closes, the loss can erase many earlier gains at once. A smooth balance curve is not proof of low risk.
We saw this first-hand when we rebuilt a commercial AUD/CAD grid-and-martingale EA to test it. Over three calm months it gained about 77%. Run through the sharp sell-off of April 2025 and a longer trending period, it lost more than 90% of the account.

Worked example: exposure level by level
Take a buy grid on EUR/USD with a 20-pip step, a starting size of 0.01 lots and a multiplier of 2.0. The first buy opens at 1.1000. If price falls, new buys open at 1.0980, 1.0960, 1.0940, 1.0920 and 1.0900, so the six trades are 0.01, 0.02, 0.04, 0.08, 0.16 and 0.32 lots. The total after six levels is 0.63 lots.
For EUR/USD, 1.00 lot has a pip value of $10, so 0.01 lots is $0.10 per pip and 0.32 lots is $3.20 per pip. If price reaches 1.0900, the open loss is $114:
- 0.01 lots × 100 pips × $10 = $10
- 0.02 lots × 80 pips × $10 = $16
- 0.04 lots × 60 pips × $10 = $24
- 0.08 lots × 40 pips × $10 = $32
- 0.16 lots × 20 pips × $10 = $32
- 0.32 lots × 0 pips = $0
The weighted average entry price is about 1.0918, because the larger later trades pull the average down towards 1.0900. Price only needs to rise about 18 pips from 1.0900 to reach that average. But if price falls another 100 pips to 1.0800 with the same six trades open, the loss grows to $744: $20 + $36 + $64 + $112 + $192 + $320.
Exposure also affects margin. The six trades total 63,000 euros, worth about $68,670 at 1.0900, so the margin at 1:100 leverage is about $687 ($68,670 ÷ 100). Our guide to leverage and margin explains this link in more detail.

Margin calls, basket stops and forced exits
A margin call happens when equity falls too low relative to the margin used by open trades. If it keeps falling to the stop-out level, the broker closes trades, usually starting with the one showing the largest loss, until the margin level recovers. For a grid EA this can break the basket up at its worst point: losses are locked in while the remaining trades stay open. Higher leverage leaves less room for drawdown before that happens.
A basket stop closes all trades in a basket when the total floating loss reaches a set amount or percentage, such as a $500 loss or 10% of the account balance. It can prevent a margin call in some cases, but it turns a floating loss into a realised loss.
Other safety rules help, but each has a trade-off. A maximum number of levels limits total exposure, and a maximum drawdown rule can stop new baskets, but neither removes the risk in baskets already open. Before you use any grid EA, write down which rules it has and their exact numbers.
How to read a grid EA backtest honestly
Start with equity drawdown, not balance growth. Look for the largest equity drawdown, the longest period spent in drawdown and the margin level at the worst point. A high balance with a deep equity drawdown shows that the system held large floating losses. Our guide to drawdowns and losing streaks explains recovery: a 20% drawdown needs a 25% gain, because $80 needs $20 to reach $100 again, and $20 ÷ $80 = 25%.
Next, check how many levels the basket reached, and whether the test included a strong trend. A test on a ranging period alone will flatter a grid EA. If the test never reached the maximum levels, a live trend could still take it there.
Finally, check the settings used in the test. A backtest with a small grid step, a high multiplier, no basket stop and high leverage will behave very differently from the same EA with wider steps, a lower multiplier and a basket stop. If the seller will not share the settings, spread, test period and equity drawdown, treat the result as incomplete. Our guide on how to judge an Expert Advisor lists the checks in full.
Grid EA mistakes
- Judging a grid EA from balance alone, without checking equity drawdown and floating loss.
- Starting with a size that looks small on the first trade, without adding up the full basket.
- Using a high multiplier and a small grid step together, so exposure grows very fast.
- Running a grid EA with no basket stop, no maximum levels and no equity stop.
- Testing only on a ranging period, then assuming the result will hold in a trend.
- Increasing leverage to fit more levels, without checking the stop-out level.
FAQ
Are grid EAs safe?
No grid EA is safe in an absolute sense, because safety depends on the grid step, the size multiplier, the maximum levels, the stop rules, the pair, the leverage and the account size. A grid with wide steps, equal sizes, a maximum level limit and a basket stop carries less risk than one with small steps, a high multiplier and no stop.
Why do martingale EAs often look good at first?
Ranging markets give many small retracements, and each retracement can close a basket with a gain. Losing baskets are held open rather than closed, so the balance can rise while floating losses grow.
What is a basket stop?
A basket stop is a rule that closes all open trades in a grid basket when their combined floating loss reaches a set amount or percentage. It is meant to limit the loss from one basket and reduce the chance of a margin call. It does not remove risk, because the loss it closes is still a real loss.
Can a grid EA work on gold or GBP/USD?
A grid EA can be coded for any pair, including XAU/USD and GBP/USD, but volatile markets change the risk. Gold can move a long way in a short time, and GBP/USD can trend strongly, so a grid step that suits EUR/USD may be too small for them. The step, size, maximum levels and stop must be set for the volatility of the specific market.
How much should I risk on a grid EA?
There is no single safe amount, because the risk is the maximum basket loss, not the first trade. Work out the worst basket loss under your settings, including the maximum levels and a trend beyond them, and compare it with your account size. If it is more than you can accept, reduce the starting size, widen the step, lower the multiplier or add a basket stop.
To compare a grid system with fixed risk per trade, read how much to risk per trade and risk of ruin in trading, and work out your own limits before you trade live.
Keep reading: drawdowns and losing streaks, leverage and margin explained and risk of ruin in trading.
Risk note: trading forex carries a high level of risk and may not be suitable for everyone. This article is for education only and is not financial advice.
Have a strategy you want automated?
We turn trading rules into tested Expert Advisors for MT4 and MT5. Tell us how you trade and we'll send a specification and a quote.
More articles

Automated trading8 min read
What is an Expert Advisor (EA) and how does it work?
An Expert Advisor is a program that trades for you in MetaTrader from rules you set. How it works, what it can and can't do, and how to judge one.
Read article
Automated trading8 min read
How to turn your trading strategy into an EA
Turn a trading idea into exact EA rules, test it properly and hire a developer with confidence: the specification, the testing and the red flags.
Read article
Automated trading8 min read
Forex VPS for EAs: do you need one, and how to set it up
A forex VPS keeps your Expert Advisor running when your own computer is off. When you need one, how much power it needs and how to set it up.
Read article