Home / Blog / How to protect a martingale grid bot on gold: 7 protections and…

How to protect a martingale grid bot on gold: 7 protections and what each one really gives

No setting makes a martingale grid bot on gold safe; seven protections limit how much one bad move can take, and only two of them change the outcome without costing income: the deposit behind each 0.01 lot and a cap on orders and total lots — the other five (equity stop, ATR step, news and trend filters, margin control, emergency close) buy a smaller worst case with income or slower recovery, and a stress test on real ticks shows which trade you are making.

Protecting a martingale bot: 7 protections for a gold grid bot, tested on real ticks
7 protections for a gold grid bot, tested on real ticks

Arithmetic of settings and results of our model on past ticks, not a forecast and not advice. Trading with leverage carries risk: if the deposit is too small, a stop-out is possible.

On this page (12)

What does "protecting" a martingale bot mean?

A martingale grid bot opens a first order and, when price goes against it, adds a bigger order every fixed step, so that a small pullback closes the whole basket in profit. A protection is any rule that limits what a long move without a pullback can do to the account: it either moves the stop-out further away or closes the basket before the broker does.

Every protection has a price. It is paid in one of three currencies: money up front (a bigger deposit), income (fewer or smaller baskets, losses taken that would have recovered) or time (baskets stay open longer). If a protection seems free, look for which of the three it charges.

The worked example on this page is the default of the grid calculator: cent account, $1,000, first lot 0.01, multiplier ×2, step $1.95, 11 orders, 1:2000, stop-out 40%. With these settings the stop-out comes $65.58 below the first order (why grid EAs blow gold accounts).

The 7 protections at a glance

ProtectionHelps withWhat it costsHow to verify
1. Equity drawdown limit (basket stop) + pauseCaps the loss of one basket and of one bad dayRealised losses on baskets that would have recoveredEmulator: "Basket stop, % of balance" and "Pause after stop"
2. Cap on multiplier, orders and total lotsMoves the stop-out much further awaySlower recovery, longer open basketsGrid calculator, martingale lot size calculator
3. Volatility (ATR) stepStretches the ladder when gold is moving fastFewer baskets; it reacts after the move has startedGrid calculator (step), emulator
4. News and trend filtersSkips the widest hours (news)Less trading; trend filters showed no edge in our testsGold news days article, emulator replay
5. Margin level controlStops adding orders the account cannot carryWarns late on a high-leverage accountMargin calculator, grid calculator
6. Emergency basket close or lockTurns a possible stop-out into a chosen lossMany false alarms; in our model it ate a large part of incomeEmulator replay of the hardest days
7. Stress test before going liveShows how your exact settings behaved on the worst daysTime; a model is not a guaranteeEmulator "Settings test" over the whole history

1. Equity drawdown limit: a hard stop for the basket

What it does. Closes the whole basket when its floating loss reaches a set share of the balance, for example 10%. The loss becomes real, but it is the size you chose, not the size the broker chose at stop-out. A pause after the stop (no new baskets for, say, 120 minutes) keeps the bot from starting a fresh basket straight into the same move.

What it costs. Most stopped baskets would have come back. In our model on 93 weeks of gold ticks, tight basket stops fired 6 to 15 times a week, and about 95–98% of the stopped baskets would have recovered if left open. Each of those is a realised loss.

In our model. The pause matters more than the stop level: a 120-minute pause after a stop cut the worst day about 2.5 times (in one tested variant, from −$140 to −$51).

Check it yourself. In the Midas Grid emulator, settings "Basket stop, % of balance" and "Pause after stop, min". Run the same period with the stop off and on and compare the worst day and the total. More in how to limit grid risk.

2. Limit the multiplier, the number of orders and the total lot

What it does. Each extra order of a ×2 grid doubles the basket at the bottom. The total lots of a full basket (its tonnage) is what each $1 of gold against you costs on a cent account. Capping orders cuts the tonnage in half per order removed:

Orders (×2, from 0.01)Total lotsStop-out below the first order on $1,000
1120.47$65.58
1010.23$112.54
95.11$208.55

What it costs. After the last allowed order the basket stops averaging, so it needs a bigger pullback to close and stays open longer. In our model over 22 months, a cap of 9 orders had 72 baskets open longer than 4 hours, against 42 with 11 orders.

In our model. At $1,050 per 0.01 lot and step $1.95, the number of account blow-ups over 22 months was 6 with 9 orders, 9 with 10 and 10 with 11. Eleven orders were worse in every variant we tried. The deposit per 0.01 lot remained the strongest single lever.

Check it yourself. The grid calculator shows the stop-out distance for your orders and deposit; the martingale lot size calculator finds the largest first lot for the move you want to survive. What each setting does: grid step, multiplier and order count.

3. Grid step by volatility (ATR)

What it does. Sets the distance between orders from recent volatility (ATR, the average true range of the last candles): wider when gold moves fast, narrower when it is calm. A wider step stretches the ladder, so the basket fills more slowly in a fast move.

What it costs. ATR measures the past. A jump like the hour 15:00–16:00 UTC on 29 January 2026, when gold fell $314.21, arrives before ATR has widened. In calm periods ATR narrows the step and the grid fills on a small move, which is exactly when a sudden break hurts. Fewer orders per move also mean fewer baskets and less income.

In our model. The size of the next move is partly predictable from the last hour (on our ticks, the realised volatility of the last 60 minutes correlated with the size of the next 15-minute move at r ≈ 0.52). The direction was not: across trend, impulse and breakout signals the chance that price continued rather than turned was about 51.6%, a coin toss. A step that widens on the far orders by a fixed rule cut blow-ups in our model from 6 to 3 over 22 months at $1,050 per 0.01, but the result was sensitive to small changes of the setting.

Check it yourself. Change only the step in the grid calculator and watch the stop-out distance and the pullback needed to break even. Full analysis: grid step by volatility (ATR).

4. News and trend filters

What it does. A news filter keeps the bot from starting baskets around scheduled releases (NFP, CPI, FOMC). A trend filter lets a basket start only in the direction of an indicator.

What it costs. Less trading, so less income. And a filter decides only when a basket starts, not how far price runs against a basket that is already open.

In our model. News hours really are wider: on our ticks a release hour moved about 2.4 times more than other hours ($29.55 against $12.53 median range), and after NFP the first ±$20 came in a median 4.7 minutes. But none of the 25 widest hours of 2025–2026 had a scheduled release, and of 26 account blow-ups we examined in the model, only one fell in a window around a major release, no more than on random control days. Trend and session filters did no better than placebo: the 51.6% coin toss above applies to them too.

Check it yourself. Replay a release day in the emulator. Read gold on NFP, CPI and FOMC days and entry filters and Smart Money in a grid EA.

5. Margin level control

What it does. Margin level is equity divided by used margin, in percent. The broker warns at the margin call level and starts closing positions at the stop-out level. A bot can refuse to add an order when free margin is not enough, or stop new baskets below a margin level you set.

What it costs. On a high-leverage account the margin of the basket is tiny, so margin level stays high until the equity is almost gone. In our example, at the bottom of a full 11-order basket the margin is about $43. When gold is $60 below the first order, the margin level is still 308% and equity is $131 of $1,000. The margin call (60%) comes only about $65.2 below the first order, with about $26 left, a fraction of a dollar before the stop-out. On such an account, margin level is a late alarm, not a protection.

Check it yourself. The margin calculator shows the margin per lot at your leverage. More: margin call vs stop-out.

6. Emergency basket close and lock

What it does. Closes or freezes a basket before the stop-out: a hard close at a set loss, a close when price comes back near break-even after running past the last order, or a lock, an opposite order of the same size that freezes the floating loss without closing it.

What it costs. False alarms. In our model, for every blow-up that a "close near break-even" rule saved, it fired 10 to 60 times on baskets that would have closed in profit, at $15–60 each. A lock costs spread and swap, and you still need a way out of it.

In our model. On a small deposit ($900 per 0.01, 9 orders) the close-near-break-even rule halved blow-ups (8.4 → 4.3 over 21 months) at the price of about a quarter of income; on $1,800 per 0.01 it only did harm. An automatic lock ladder removed blow-ups entirely and turned income negative: −$33 a month against +$160 a month without protection, on $1,800 per 0.02 lot. Taking the direction out of the lock was no help either: no indicator we tested told which way price would go after the lock (51.6%).

Check it yourself. Replay the days a basket went past its last order in the emulator and note where price came back. More: locking a position.

7. Stress test before going live

What it does. Runs your exact settings through the hardest stretches of real gold history before real money does. Three answers matter: did the account survive, how deep did the deepest basket go, and how much deposit would it have needed.

What it costs. An evening. And modesty about the answer: a model has a constant spread, no slippage, and the past will not repeat in the same order.

The stretches to include. 28 January – 2 February 2026 (16 of the 25 widest hours of the data, including −$314.21 in one hour on 29 January), 3 March 2026 and 23 March 2026, when gold moved more than $110 in each direction within the same day. The full list: biggest 1-hour gold moves.

Check it yourself. Step-by-step guide: stress test of a grid EA on real ticks. The emulator is free and runs in the browser.

Which protections matter most?

In the order of what they change, according to our arithmetic and our model:

  1. Deposit per 0.01 lot. The only lever that buys room without changing the strategy.
  2. Cap on orders and total lots. Each order fewer halves the basket at the bottom.
  3. A stress test, because it tells you whether 1 and 2 are enough for your settings.
  4. Equity stop with a pause, and emergency close: they cut the worst outcomes and cost income.
  5. ATR step, news and trend filters, margin control: useful to understand, but they do not change how far price can run against a full basket.

FAQ

What is the best timeframe for a grid EA: M1, M5 or M15?

A grid does not trade candles; it trades price distance. A step of $1.95 is the same $1.95 on M1, M5 or H1, and the basket closes on the same pullback. The timeframe matters only for indicator-based entry filters, and in our tests those filters did not change how often a deep basket reached the stop-out. Choose the step and the deposit, not the chart.

Is a lower multiplier (1.2–1.5) safer than ×2?

Only if the basket ends up smaller. With the same total lots it is not: 11 orders at ×2 from 0.01 carry 20.47 lots and reach the stop-out on $1,000 at $65.58; 11 orders at ×1.5 from 0.12 carry 20.48 lots and reach it at $63.85. And the lower multiplier needs a bigger pullback to close: from the last order to break-even $3.64 at ×1.5 against $1.94 at ×2 (and $6.41 at ×1.2 from 0.70). Check it with the averaging break-even calculator.

Does a stop loss make a martingale bot safe?

It makes the worst loss a number you chose instead of a stop-out. In our model most stopped baskets would have recovered, so a stop costs income; a pause after the stop cut the worst day about 2.5 times. A stop limits damage; it does not make the strategy safe.

Can any setting make a grid bot risk-free?

No. Every protection moves the stop-out further or chooses a smaller loss, and each one costs money up front, income or time. A deposit large enough for any move would make the income negligible.

How do I check these protections on my own settings?

Calculate the stop-out distance in the grid calculator, then run the settings day by day in the free Midas Grid emulator over the whole history since January 2025, including late January 2026.