Trading process

Invalid Stops on Gold: Fixing MT4 Error 130 and MT5 Error 10016 on XAUUSD

You type a stop-loss on a gold trade, press Modify, and MetaTrader says 'Invalid stops'. The platform is checking your levels against a precise set of rules, using the price that would close your trade and a minimum distance set by your provider. Once you know the rules, the fix takes seconds.

Gold spot$4,041.6+120.7 (+3.08%)NextUS ISM services PMI (October)in 39m · Wed 15:00 GMTMarket openpause in 7h 39mRange$134.0
Gold price, last 12 monthsGold price, last 12 monthsHigh $5,318 (29 Jan 2026) · low $3,899 (30 Oct 2026) · 12-month change −2.2%$4,500$5,000$4,055Nov ’25Jan ’26Mar ’26May ’26Jul ’26Sep ’26
COMEX gold, daily closes, last 12 months · data to 4 Nov 2026 · xauusdglobal.com

The short answer

“Invalid stops” means your stop-loss or take-profit breaks one of three rules. It is on the wrong side of the price that would close your trade; it is closer than the stops level, the minimum distance your provider sets for gold; or the order is inside the freeze level, so it can’t be changed right now. MT4 shows this as error 130, MT5 as 10016, “Invalid stops in the request”.

The fix: move the level further away, measured from the bid for buys and the ask for sells, by more than the Stops level shown in gold’s Specification.

Why it happens: the exact rules

MetaQuotes publishes the rules. Buys open at the ask and close at the bid; sells open at the bid and close at the ask. Stops and targets are measured from the closing price:

Order Stop-loss rule Take-profit rule
Buy (long) Bid − SL ≥ StopLevel TP − Bid ≥ StopLevel
Sell (short) SL − Ask ≥ StopLevel Ask − TP ≥ StopLevel
Buy limit Open price − SL ≥ StopLevel TP − Open price ≥ StopLevel
Sell limit SL − Open price ≥ StopLevel Open price − TP ≥ StopLevel
Buy stop Open price − SL ≥ StopLevel TP − Open price ≥ StopLevel
Sell stop SL − Open price ≥ StopLevel Open price − TP ≥ StopLevel

Pending orders have their own entry rule: a buy limit must be at least the stops level below the ask, a sell limit above the bid, a buy stop above the ask and a sell stop below the bid. A pending order on the wrong side gives “invalid price” (MT4 129, MT5 10015) instead.

The freeze level works similarly but blocks changes: for a buy, you cannot modify if Bid − SL or TP − Bid is not greater than the freeze level; for a sell, the same with the ask. MT4 reports this as 145, “Modification denied because order is too close to market”; MT5 as 10029, “Order or position frozen”.

Points, pips and dollars on gold

The stops level is given in points, the smallest price step of the symbol. On gold, that depends on how many decimals your provider quotes:

Gold quoted as One point Stops level 100 points Stops level 50 points
4000.25 (2 decimals) $0.01 $1.00 $0.50
4000.253 (3 decimals) $0.001 $0.10 $0.05

Many traders call $0.10 a pip on gold; our pip calculator explains the conventions. Mixing up points and pips is the most common cause of invalid stops in EAs.

A worked example (illustrative)

You sell 0.10 lot of XAUUSD. The bid is $4,000.00, the ask $4,000.30 (a $0.30 spread). Gold is quoted to 2 decimals and the Specification shows Stops level: 100, so the minimum distance is $1.00.

  • Stop-loss: must satisfy SL − Ask ≥ $1.00, so SL ≥ $4,001.30. You typed $4,001.00, which is only $0.70 above the ask: invalid stops.
  • Take-profit: must satisfy Ask − TP ≥ $1.00, so TP ≤ $3,999.30. A target at $3,999.50 would also be rejected.

Move the stop to $4,001.30 or beyond and it is accepted. Notice that the minimum distance is measured from the ask, not from the bid your chart shows, which is why a level that looks $1.00 away on the chart can still fail. With 0.10 lot, each $1 is worth $10, so a stop at $4,005.00 risks about $50 plus costs.

The spread matters too. If the spread widens to $1.50 at the daily break, the ask is $4,001.50 and your stop at $4,001.30 is now on the wrong side: you can’t place it at all until the spread narrows.

Exactly how to fix it, step by step

  1. Check the side. For a buy, SL below and TP above the bid. For a sell, SL above and TP below the ask.
  2. Turn on the ask line (right-click the chart → Properties (F8) → Show Ask line in MT4, Show Ask price line on the Show tab in MT5) so you can see the price sell orders are measured from.
  3. Open the Specification (right-click gold in Market Watch) and read Stops level and Freeze level, and note how many digits the price has.
  4. Convert to dollars using the table above and add a margin: the distance must exceed the stops level plus any spread widening you could meet.
  5. Retry with the wider level. If you need a tighter dollar risk, reduce the lot size instead; the position size calculator does it in seconds.
  6. If modification is refused near price (145 / 10029), wait until price moves away from your level, or close the trade manually.
  7. On market-execution MT4 accounts, if an order with SL/TP attached is rejected, open it without them and add the stop and target immediately with Modify. Many EAs do this in two steps for that reason.

Notes for EA users

  • Read MODE_STOPLEVEL and MODE_FREEZELEVEL with MarketInfo() in MT4, or SYMBOL_TRADE_STOPS_LEVEL and SYMBOL_TRADE_FREEZE_LEVEL with SymbolInfoInteger() in MT5, rather than hard-coding a distance.
  • Multiply by Point / _Point, not by a fixed 0.01 or 0.1, so the EA works whatever the digits.
  • Normalise every price with NormalizeDouble(price, Digits) (MT4) or _Digits (MT5).
  • Measure sell stops from the Ask, buy stops from the Bid.
  • The full list of codes is in our MT4 and MT5 error codes reference.

How to avoid it from now on

  • Keep stops at a volatility-based distance: the ATR stop-loss calculator usually puts gold stops far beyond any stops level.
  • Don’t set or move stops in the minutes around the 5 pm New York break or big releases, when spreads are widest.
  • Write your symbol’s stops level, freeze level and digits in your trading plan.

For setting stops on a phone, see how to set stop-loss and take-profit on gold in MT5; for other errors, MT5 gold errors explained and gold trading problems solved.

Sources

Educational content only, not financial advice. Stops levels and execution types vary by provider. Trading gold with leverage carries a high risk of loss.

Frequently asked questions

What does 'invalid stops' mean on gold?

Your stop-loss or take-profit breaks one of the platform’s rules: it is on the wrong side of the current price, it is closer to the price than the symbol’s minimum distance (the stops level), or the trade is inside the freeze level and can’t be modified. MT4 reports it as error 130, MT5 as 10016 ‘Invalid stops in the request’.

What is the stops level on XAUUSD?

It is the minimum distance, in points, between the current price and a stop-loss, take-profit or pending order, set by your provider for that symbol. You can see it in the symbol’s Specification as Stops level. On a gold symbol quoted to two decimals, one point is $0.01, so a stops level of 100 means $1.00. A value of 0 means no fixed minimum, but the levels must still be on the correct side of the price.

Which price is my stop compared with?

The price that would close the trade. A buy (long) is closed at the bid, so its stop-loss must be below the bid and its take-profit above it by at least the stops level. A sell (short) is closed at the ask, so its stop-loss must be above the ask and its take-profit below it.

Why does my EA get error 130 when I can set the same stop by hand?

Common reasons: the EA calculates the distance in points but the symbol has a different number of digits than it assumes, it uses Bid where it should use Ask (or the reverse), it doesn’t normalise prices to the symbol’s digits, or the account uses market execution and wants stops added after the order is filled. Read the stops level and digits from the symbol in code.

What is the freeze level?

A second distance, in points, inside which the provider will not let you modify or delete orders because price is about to reach them. If price is within the freeze level of your stop, take-profit or pending order, a modification is refused until price moves away.

Comments

No comments yet.

Leave a comment

Comments are checked before they appear. Be respectful: no promotion, no trade signals. Rules · Privacy. No email needed.