Is grid trading profitable? The real risks of grid and martingale EAs
Grid and martingale EAs often show long runs of small wins and a smooth balance curve. By the end you will know where the risk hides, how quickly exposure grows, why most prop firms restrict them, and how to build and test a safer version.
Based on our team’s research and live testing since 2018.
Grid and martingale EAs are some of the most requested and most misunderstood systems in retail trading. Their backtests often show hundreds of winning baskets in a row and a balance curve that only goes up. The risk is real, but it does not appear in the balance until it is very large. This guide shows where it hides, with worked numbers.
How does a grid EA work?
A grid EA places positions at fixed price intervals. If price moves against the first trade, it opens another at the next level, and another, building a basket. When price moves back far enough, the whole basket closes at a small combined profit, because the average entry price has improved with each level.
In a range, this works well: price wanders up and down and the baskets keep closing. In a strong one-way trend, the basket keeps growing and the floating loss with it. When I build a grid as part of custom EA development, the limits described later in this guide are part of the specification from the start.
How does martingale differ?
Martingale increases the lot size after each loss or each new level, often doubling it. One small move back then recovers all earlier losses. The cost is that position size grows exponentially. Many “grid” EAs use a lot multiplier, which makes them martingales too, and changes the risk completely.
Why do grid equity curves look so smooth?
Because the Strategy Tester’s balance curve only changes when trades close, and grid baskets close almost only in profit. The losing part sits in open positions, as floating loss in equity. A balance curve can rise steadily while equity, at times, falls far below it.
So read the equity drawdown in the report, not the balance drawdown, and look at the equity curve, not only the balance line. In MT5, TesterStatistics(STAT_EQUITY_DDREL_PERCENT) gives the worst equity drawdown in percent and STAT_MIN_MARGINLEVEL the lowest margin level reached, both readable in OnTester().
How fast does the exposure grow?
Illustrative numbers: a buy grid with 20 pips between levels, a first lot of 0.01, and a pip value of $10 per 1.00 lot. The grid keeps 0.01 lots per level; the martingale doubles the lot at each level. Floating loss is shown when the latest level has just opened, before spread, commission and swap.
| Levels open | Move against first entry | Grid lots | Grid floating loss | Martingale lots | Martingale floating loss |
|---|---|---|---|---|---|
| 1 | 0 pips | 0.01 | $0 | 0.01 | $0 |
| 2 | 20 pips | 0.02 | $2 | 0.03 | $2 |
| 4 | 60 pips | 0.04 | $12 | 0.15 | $22 |
| 6 | 100 pips | 0.06 | $30 | 0.63 | $114 |
| 8 | 140 pips | 0.08 | $56 | 2.55 | $494 |
| 10 | 180 pips | 0.10 | $90 | 10.23 | $2,026 |
| 12 | 220 pips | 0.12 | $132 | 40.95 | $8,166 |
On an illustrative $10,000 account, the martingale’s floating loss is about 20% of the account at level 10 and about 82% at level 12. Each extra level roughly doubles it. The margin needed to hold that many lots would usually end the sequence even earlier. The fixed-lot grid grows much more slowly, but it still grows faster than the move itself, and with larger first lots the same shape applies at a larger scale.
The question to ask is not “how often does this happen?” but “has my symbol ever moved this far without a big enough pullback?” Check your own data.
Is grid trading profitable?
A grid or martingale changes the shape of results, not the edge. It turns many trades into frequent small wins and rare large losses. If the entries have no edge, rearranging position sizes cannot create one, and trading costs make the long-run result slightly negative.
A grid can make money for long periods, especially in ranging markets, and a grid with a trend filter and hard limits can be a reasonable design. Whether it is profitable overall depends on whether the rare large loss has been included in the test, and whether the account can survive it. A backtest that never met a strong trend has not tested the strategy.
Why do most prop firms restrict grid and martingale EAs?
- Floating losses count. Daily and maximum drawdown limits at many firms are measured on equity, so a basket’s open loss can breach the limit before anything closes. See static vs trailing drawdown.
- Rules often name them. Many firms ban or restrict martingale, and some restrict grid trading or treat it as high-risk behaviour. Rules differ and change, so check your firm’s current rulebook.
- Sizing patterns get flagged. Lot sizes that grow after losses are easy for a firm’s risk team to spot in the trade history.
For these reasons we label grid and martingale logic as not for most funded accounts, and tell clients before any work starts. Our prop-firm compliance guide lists the other rules that fail evaluations.
How can you make a grid EA safer?
- Cap the number of levels. A hard maximum turns an open-ended risk into a known one.
- Use a basket stop. Close the whole basket when its combined loss reaches a set amount.
- Add a daily loss limit on equity, so a bad day ends trading instead of adding levels.
- Space levels by volatility, for example as a multiple of ATR, so the grid widens when the market moves more.
- Do not multiply lots. Fixed lots per level keep the growth in the table above in the slow column.
- Add a trend filter so new levels are only added in one direction, or not at all in a strong trend.
Here are the first three as checks an MQL5 grid EA runs before opening a new level:
1// Checks a grid EA runs before it opens another level (limits are examples)2input int InpMaxLevels = 5; // hard cap on open levels3input double InpBasketStopPct = 3.0; // basket loss, % of balance, that closes everything4input double InpDailyLossPct = 2.0; // no new levels after this loss today5input long InpMagic = 26101;6 7double BasketProfit(int &levels)8{9 double pl = 0.0;10 levels = 0;11 for(int i = PositionsTotal() - 1; i >= 0; i--)12 {13 ulong ticket = PositionGetTicket(i); // also selects the position14 if(ticket == 0) continue;15 if(PositionGetString(POSITION_SYMBOL) != _Symbol) continue;16 if(PositionGetInteger(POSITION_MAGIC) != InpMagic) continue;17 pl += PositionGetDouble(POSITION_PROFIT) + PositionGetDouble(POSITION_SWAP);18 levels++;19 }20 return pl;21}22 23bool MayAddLevel(double dayStartEquity)24{25 int levels;26 double basket = BasketProfit(levels);27 double balance = AccountInfoDouble(ACCOUNT_BALANCE);28 double equity = AccountInfoDouble(ACCOUNT_EQUITY);29 30 if(levels >= InpMaxLevels) return false; // level cap31 if(basket <= -balance * InpBasketStopPct / 100.0) return false; // basket stop: close, never add32 if(dayStartEquity - equity >= dayStartEquity * InpDailyLossPct / 100.0)33 return false; // daily loss limit34 return true; // the new level uses the SAME lot size: no multiplication35}With a level cap and a basket stop, the maximum loss per basket can be estimated before the EA ever runs. That number, not the win rate, decides the lot size. Use the position size calculator to work backwards from it.
How do you test a grid EA honestly?
- Use real ticks and full costs. Grids trade often and close on small moves, so spread and commission matter. Our tick-data backtesting guide covers the setup.
- Include strong trends. Test over years, and make sure the period contains the symbol’s largest one-way moves.
- Vary the start date. A grid started just before a big trend behaves very differently from one started after it.
- Record the worst basket: maximum levels reached, maximum floating loss, and lowest margin level.
- Judge equity, not balance. The equity drawdown is the risk you actually carry.
Checklist
- Lot multiplier off, or its exponential growth fully understood
- Level cap, basket stop and daily equity limit coded and tested
- Spacing matched to the symbol’s volatility
- Test covers the largest trends in the data, from several start dates
- Equity drawdown and worst basket reviewed before any profit figure
- Prop-firm rules checked: not for most funded accounts
Quick answers
What is the difference between a grid and a martingale?
A grid adds positions at fixed price intervals, usually with the same lot size. A martingale increases the lot size after each loss or each new level. Many grid EAs also use a lot multiplier, which makes them martingales as well.
Why does my grid EA have a high win rate?
Most baskets close at a small profit once price pulls back. The losses are rarer and much larger, so the win rate says little about the risk.
Can a grid EA pass a prop-firm challenge?
Many firms restrict grid or martingale trading, and equity-based drawdown limits count floating losses. Check the current rulebook. In general, grid and martingale logic is not for most funded accounts.
Does a stop loss on each grid level fix the risk?
It caps each level, but several levels can still be stopped out in one move. A basket stop on total floating loss, plus a level cap, is the more reliable limit.
Is a grid safer on gold or on currency pairs?
Neither is safe by default. Grid spacing must match the symbol’s volatility, and gold can move a long way in one direction. Size every level from the worst move in your test, not the average.