Grid & basket EAs
0 tools
Nothing matches yet. Request it and the lab may build it.
A grid or basket EA does not try to pick one perfect entry. It opens a series of trades at fixed price steps and closes them as a group once the whole basket reaches a target. It solves the problem of not knowing exactly where a range will turn. The trade-off is clear: many small wins are common, and rare large drawdowns are part of the design.
How a grid EA builds and closes a basket
Most EAs in this group follow the same cycle.
- Open the first trade. Sometimes on a signal, sometimes at once.
- Add trades at steps. If price moves against the basket by a set distance, say 20 pips, the EA opens another trade.
- Track the basket. The EA adds up the profit and loss of all open trades.
- Close everything together. When the basket reaches its target, all trades close at once, even if some are still in a loss.
Some grids place pending orders in advance at each level. Others open market orders as price reaches each step.
Fixed grid, averaging, martingale, hedging and recovery compared
| Type | How it adds trades | Typical lot pattern | Main risk |
|---|---|---|---|
| Fixed grid | Every X pips, one direction | Same lot each time | Many open trades in a long one-way move |
| Averaging | Adds against the move to improve average price | Same or slightly larger | Margin use climbs as price runs away |
| Martingale | Adds against the move | Lot multiplies, e.g. x1.5 or x2 | Lot size grows very fast; margin can run out |
| Hedging grid | Opens both buys and sells | Varies | Locked positions, swap costs, complex exits |
| Recovery | Uses new trades to close an old loss | Often increasing | Turns one loss into a large exposure |
If you are new to this group, start with a fixed grid at a constant lot. It is the easiest to understand and the easiest to size. Martingale is the hardest to size safely. Hedging uses long and short positions at the same time, which some brokers and account types do not allow.
Why the equity curve looks smooth until it does not
Grid EAs usually close most baskets in profit. The equity curve climbs in small steady steps for weeks or months. This is the part people share.
The risk sits in the open trades. While the balance rises, floating losses can build up in a basket that has not closed yet. If price keeps moving one way, the basket keeps growing.
Example: a martingale grid starts with 0.01 lots, steps every 20 pips and doubles the lot each step.
- Step 1: 0.01 lots
- Step 2: 0.02 lots
- Step 3: 0.04 lots
- Step 4: 0.08 lots
- Step 5: 0.16 lots
- Step 6: 0.32 lots
After 6 steps the EA holds 0.63 lots in total, and price has moved 100 pips against the first trade. At about 10 dollars per pip per lot on a standard pair, the floating loss is about 115 dollars and climbing by more than 60 dollars for each further 10 pips. Four more steps would put more than 10 lots on the chart. A move of a few hundred pips in one direction is not rare, especially in trending weeks or around major news.
Trade caps and equity stops that limit grid drawdown
Look for these inputs:
- Maximum number of trades. A hard cap on how many steps the grid can add.
- Maximum lot or lot multiplier. Keep the multiplier at 1.0 unless you fully understand the growth.
- Equity stop. Close the whole basket if the floating loss reaches a set percentage, such as 20% of the account.
- Step size based on volatility. Wider steps in fast markets slow the growth of the basket.
- Trading hours or news pause. Avoid starting new baskets before major releases.
A simple if/then rule: if the EA has no equity stop and no trade cap, the maximum loss is the whole account. Set at least one of the two before going live.
Use the trading calculators or a margin calculation to check how much margin the full grid would need at its maximum size. If your account could not hold every step at once, reduce the lot or the number of steps.
Backtest a grid through at least one strong one-way trend
Backtest over several years, and make sure the period includes at least one strong one-way trend on that symbol. Ranging months alone tell you almost nothing.
In the MetaTrader 5 Strategy Tester, watch the equity line, not only the balance line. The gap between them is the floating risk. The largest equity drawdown is the number that matters.
Run grids on a separate account or with a small part of your capital. Grid drawdowns are hard to sit through, and the urge to intervene at the worst moment is strong. Our article on trading psychology covers why.
For overall position sizing, read what risk management means in trading. Then pair the EA with a drawdown or equity monitor from the risk and lot size tools, and forward test on demo until you have seen at least one deep basket play out.









