Do Fair Value Gaps Work? We Tested 38,114 Returns to FVGsRead article →
A grid EA places orders at fixed distances from each other, for example 20 to 50 pips apart on a currency pair, and lets the market fill them. When price moves against the first order, the next one fills at a better price, and the next after that. The positions are closed together once the combined result reaches a target.
Seen that way, a grid isn’t many small trades. It’s one position built in pieces. Every filled level lowers its average price, which brings the break-even closer, and adds to its size, which makes every further pip against it more expensive. Whether a grid EA survives depends on the balance between those two effects, and on what it does when the market doesn’t come back.
Below are the main kinds of grid EA, the average-price arithmetic behind them, what lot multipliers really do, the risk controls a grid needs, and how to test one so the report shows its risk as well as its profit. At the end is a list of what to put in a specification if you want one built.
“Grid” describes how orders are spaced, not what they’re meant to do. The four designs below share the spacing and almost nothing else.
Several positions on one symbol behave like a single position at their volume-weighted average price:
average price = (P₁ × V₁ + P₂ × V₂ + … + Pₙ × Vₙ) ÷ (V₁ + V₂ + … + Vₙ)
where P is each order’s open price and V its volume. Take a GBP/USD buy grid with a 30-pip step and 0.10 lots per level, where a pip is worth $1 per 0.10 lot. The orders fill at 1.3000, 1.2970, 1.2940 and 1.2910. With equal volumes the average is the simple mean, 1.2955.

At the fourth order the grid holds 0.40 lots and is $180 down. Break-even is 45 pips above the market, and every further pip down now costs $4 instead of the $1 it cost at the first order. On the rebound the basket closes at the average plus 10 pips, 1.2965, for +$40 before costs. That’s the grid’s whole business model: a small, frequent gain, paid for by holding a growing position through a loss.
The formula also explains the exit rule most grid EAs use, a basket target measured from the average price or in money for all positions together. Closing levels one by one is possible, but then the EA has to track which pieces are left and recalculate the average after every close.
The appeal of a lot multiplier is easy to see in the average price. Larger lots at the lower levels pull the average down faster, so price needs to retrace less before the basket is back to break-even. The cost of that is easy to see too, once you look at the size of the position.
| Grid, 30-pip step, first order 0.10 | Lots open | Floating loss | Pips back to break-even | Cost of the next pip |
|---|---|---|---|---|
| Fixed lots, level 4 | 0.40 | −$180 | 45 | $4 |
| Lot × 1.5, level 4 | 0.82 | −$249 | 30 | $8.20 |
| Lot × 2, level 4 | 1.50 | −$330 | 22 | $15 |
| Fixed lots, level 8 | 0.80 | −$840 | 105 | $8 |
| Lot × 1.5, level 8 | 4.94 | −$2,490 | 50 | $49.40 |
| Lot × 2, level 8 | 25.50 | −$7,410 | 29 | $255 |
At the eighth level the doubling grid needs only 29 pips of retracement, against 105 for the fixed grid. It also holds 25.5 lots, and every pip further down costs $255. Thirty more pips without a bounce add another $7,650.

A multiplier doesn’t make a grid safer. It moves the risk from “often a little” to “rarely a lot”. The doubling grid recovers from most pullbacks faster than the fixed one, and one move of a few hundred pips takes a $10,000 account past zero.
A grid account rarely fades slowly. It usually runs well for a long time and then meets one move it can’t absorb. Four things set that up.
None of these remove the risk of a grid. They decide where it stops, and they make sure the EA decides, not the broker.
Underneath, the EA needs reliable bookkeeping: its own magic number, a basket calculated per symbol, and the ability to rebuild its state from the open positions after a restart. A grid that forgets after a reboot which positions belong to it can open a second grid on top of the first.
Grid backtests are known for beautiful equity curves, and for a reason. Most of the time a grid wins small amounts, and its losses come rarely and all at once. A test period without that one move shows a strategy that doesn’t exist.
A neutral grid holds buys and sells on the same symbol at once, which needs a hedging account. On a netting account opposite orders cancel each other out. US-regulated forex accounts follow NFA Compliance Rule 2-43(b), which requires first-in, first-out closing and rules out opposite positions in one pair (OANDA). FIFO also affects one-direction grids that close levels individually, since the oldest position has to go first. A grid EA for such an account has to be designed around it from the start.
Many prop firms prohibit grid and martingale strategies outright, or cap risk per trade and total open volume in ways a grid quickly breaks. The rules differ by firm and change often. We look at how firms treat automation in Automated Trading on Prop Firm Accounts.
Whether you’re ordering an EA or reviewing one you’ve bought, these are the questions it has to answer.
| Item | What to decide |
|---|---|
| Grid type | Averaging, trend, neutral or a combination, and on which symbols. |
| First entry | What starts a grid: a signal, a time, or simply the absence of an open grid. |
| Step | Fixed in pips or based on ATR, and whether it widens at deeper levels. |
| Lot sizing | Fixed, by a multiplier, or by a set table, with the maximum volume of any single order. |
| Basket exit | Target in pips from the average price or in money, and whether levels can close individually. |
| Hard limits | Maximum levels, maximum total volume, basket stop in money or as a share of equity. |
| Filters | Trend, news and weekend conditions that stop a new grid from starting. |
| Account handling | Behaviour on netting and FIFO accounts: refuse to start, or use a compatible mode. |
| Restart and logging | How the EA restores the basket after a restart, and a log of every level, average and exit. |
We write grid EAs for MetaTrader 4 and MetaTrader 5 to the client’s own rules, from simple fixed-step grids to multi-symbol baskets with volatility-based steps and equity limits. You talk directly with the developer who writes your code. Before any code is written we go through the step, sizing and exit rules with you, including the limits that decide where the grid stops, and that first consultation is free.
We test the EA with you on real ticks with your account’s costs, then on a demo account at the broker you plan to use. Bugs found after delivery are fixed at no extra cost. Since 2018 our team has completed over 3,000 development projects for traders in more than 120 countries.
Prefer to start from your platform? → MetaTrader 4 developers · MetaTrader 5 developers
A grid wins often and in small amounts, and loses rarely and in large amounts. Whether it’s profitable over time depends on how its limits handle the rare move it can’t absorb, not on how many baskets it closes in profit.
A grid spaces orders at set distances. A martingale increases the lot after a loss or at each new level. A grid with fixed lots isn’t a martingale, and a grid with a lot multiplier is one.
Use the volume-weighted average price of all open positions: the sum of each price times its volume, divided by the total volume. Add the costs of the basket, spread, commission and swap, to get the real break-even.
A step tied to the symbol’s volatility, for example a fraction of the daily ATR, adapts better than a fixed number of pips. Whatever the step, the maximum number of levels and the basket stop decide the risk more than the step does.
Many prop firms prohibit grid and martingale strategies, and US accounts follow FIFO rules that rule out neutral grids and complicate closing levels individually. Check the rules before you connect the EA.
Nordman Algorithms provides software infrastructure for trade automation and does not offer financial advice, trading signals, or managed trading services. This article is for informational and educational purposes only. Prices and results in the examples are illustrations with round numbers, not recorded trades, and exclude spread, commission and swap unless stated. Grid and martingale strategies can lose more than the account balance shown in a backtest suggests. An EA executes the rules it is given and does not adapt to market conditions outside them. Broker, regulator and prop firm rules differ and change over time. Trading leveraged instruments such as Forex, CFDs and futures carries a high level of risk and may not be suitable for all investors. Only risk capital should be used. Full Risk Disclosure