Trading process

Hedging vs Netting Accounts in MT5: Why My Buy Closed My Sell

You bought gold, then pressed Sell to open a second trade, and your buy disappeared. Or you expected one position and got two. The reason is your account's position accounting system: netting or hedging. This page explains both in plain words, checked against MetaQuotes' own help, with gold examples, how to see which one you have, and why "locking" a losing trade with an opposite one rarely saves money.

Gold spot$4,128.6+68.8 (+1.69%)NextBank of England rate decisionin 2h 34m · Thu 12:00 GMTMarket openpause in 12h 34mRange$88.8
Gold price, last 12 monthsGold price, last 12 monthsHigh $5,318 (29 Jan 2026) · low $3,899 (30 Oct 2026) · 12-month change −0.0%$4,000$4,500$5,000$4,137Nov ’25Jan ’26Mar ’26May ’26Jul ’26Sep ’26
COMEX gold, daily closes, last 12 months · data to 5 Nov 2026 · xauusdglobal.com

The short answer

MT5 has two ways of keeping track of your trades. MetaQuotes’ help calls them position accounting systems: netting and hedging. It says “the system used depends on the account and is set by the broker”.

  • Netting: one position per symbol. A sell on gold reduces, closes or reverses your gold buy. That’s why “my sell closed my buy”.
  • Hedging: each deal is its own position. A sell opens a second trade next to your buy.

Neither is a fault. But if you don’t know which one you have, the platform will surprise you at the worst moment.

Netting in plain words

Think of a single bucket for each symbol.

MetaQuotes’ help: “With this system, you can have only one common position for a symbol at the same time.” A deal in the same direction adds to it. A deal in the opposite direction makes it smaller, closes it, or reverses it if the new deal is bigger.

Gold examples (example prices, checked by script):

You hold a buy of 0.10 lot at $4,000. Gold rises to $4,010 and you press Sell:

You sell What happens on a netting account
0.05 lot Your buy shrinks to 0.05 lot. Half the profit is taken.
0.10 lot The buy is closed. Profit: $10 × 10 oz = +$100.
0.15 lot The buy is closed (+$100) and you’re now short 0.05 lot at $4,010.

MetaQuotes’ help adds: “It does not matter, what has caused the opposite deal: an executed market order or a triggered pending order.” So a forgotten sell limit or sell stop can close or flip your buy too. Check your pending orders: see buy limit vs buy stop vs sell limit vs sell stop.

Netting works like one running position per contract, which is how many traders think about futures. See gold futures vs CFD mechanics.

Hedging in plain words

Think of one card per trade.

MetaQuotes’ help: “With this system, you can have multiple open positions of one and the same symbol, including opposite positions.” A new deal “additionally” opens a new position, and “your current position does not change.”

  • To close a position on a hedging account, MetaQuotes’ help says you “explicitly select the ‘Close Position’ command in the context menu of the position”. Pressing Sell does not close your buy; it opens a sell.
  • “A position cannot be reversed in the hedging system.”

MT4 works this way too, so traders moving from MT4 often expect it. But don’t assume your MT5 account is hedging: check it.

How to check which one you have

  1. When you open a demo on PC, the account wizard has a box “Use hedge in trading”. Ticked = hedging, unticked = netting. Our demo account guide shows the screen.
  2. On a live account, check your broker’s account type page or ask support in writing.
  3. The quick test (demo only): buy 0.01 lot of gold, then sell 0.01 lot. One position gone = netting. Two positions open = hedging.

“Locking”: what hedging really does to a losing trade

On a hedging account, some traders “lock” a losing buy by opening an equal sell. The idea: the loss stops growing.

Example (example numbers, checked by script): buy 0.10 lot at $4,000 and, after gold rises to $4,010, also sell 0.10 lot at $4,010.

Gold goes to Buy Sell Total
$3,980 −$200 +$300 +$100
$4,050 +$500 −$400 +$100

The result is frozen at +$100 (here a profit, but the same works for a loss). It doesn’t matter where gold goes. So what’s the point? There isn’t much:

  • You paid the spread twice, and will pay it again to close each side.
  • You may pay swap on both legs every night. Example: −$40 per lot on the buy and −$10 on the sell is −$5 a night on 0.10 lot each. On a triple-swap night, three times that. See triple swap Wednesday.
  • Margin: your broker decides how much margin a hedged pair uses. MetaQuotes’ help says the hedging system adds a margin condition called hedged margin. Check your symbol’s Specification.
  • Later you still have to close one side first, which is the same decision you were avoiding. Our grid and hedging risks page shows how this goes wrong with robots.

If the trade is wrong, closing it is usually cheaper than locking it. See moving your stop-loss for why we avoid that decision.

Errors you may see

  • Hedging prohibited (MT4 error 149 / MT5 return code 10046): the account doesn’t allow opposite positions on one symbol. Close the existing position instead. Details are in our MT4 and MT5 error codes list.
  • FIFO rules: some accounts must close the oldest position first. Also on the error codes page.

Which is better for gold?

Netting Hedging
Positions per symbol One Many
A sell while long Reduces, closes or reverses Opens a separate sell
Scaling in and out Easy, one average price Several positions to manage
Risk of accidental reversal Higher (watch pending orders) Lower
Risk of “locking” habits None Possible

For most beginners, the one that matters is the one you know you have. If you use EAs, check the EA was written for your system: an EA built for hedging can behave very differently on netting. See gold trading bots: a checklist.

Checklist

  • ☐ I know whether my account is hedging or netting.
  • ☐ On netting, I check pending orders before pressing Sell on a buy (or Buy on a sell).
  • ☐ On hedging, I close trades with Close Position, not by opening the opposite side.
  • ☐ I don’t “lock” losing trades; I close them.
  • ☐ My EA was built for my account’s system.

Sources (checked 5 November 2026)

  • MetaTrader 5 Help, Basic principles: position accounting system: two systems, netting and hedging, “set by the broker”; netting “only one common position for a symbol”; opposite deals decrease, close or reverse; hedging “multiple open positions… including opposite positions”; Close Position command; positions can’t be reversed in hedging; hedged margin.
  • MetaQuotes, MetaTrader 5 vs MetaTrader 4 comparison (hedging and netting).
  • Prices, lots and swap rates are example numbers; the maths was checked by script.

Educational content only, not financial advice. Trading gold with leverage carries a high risk of loss.

Frequently asked questions

Why did my sell close my buy in MT5?

Your account uses the netting system. MetaQuotes’ help says that with netting ‘you can have only one common position for a symbol at the same time’, so a sell on gold reduces, closes or reverses your existing buy instead of opening a second trade.

What is the difference between hedging and netting in MT5?

On a netting account, all your deals on one symbol combine into one position. On a hedging account, each deal opens its own position, so you can hold a buy and a sell on gold at the same time. The broker sets which system your account uses.

How do I know if my MT5 account is hedging or netting?

When you open a demo on PC, the ‘Use hedge in trading’ box decides it. For a live account, check your broker’s account type details or ask support in writing. On a demo, the quick test is to buy and then sell the smallest lot of gold and see whether you end up with no position (netting) or two positions (hedging).

Can I change my MT5 account from netting to hedging?

Not on the same account. MetaQuotes’ help says the system ‘depends on the account and is set by the broker’. Ask your broker whether they offer the other type and open a new account if they do.

Is hedging (locking) a losing trade a good idea?

Usually not. Opening an equal opposite trade freezes the loss but doesn’t remove it. You pay the spread again, you may pay swap on both sides, and later you still have to decide which side to close, which is the same decision you were avoiding.

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.