Back to Glossary
Glossary

Hedging vs Netting in MT5: Can You Hold a Buy and a Sell on the Same Symbol?

A hedging account in MT5 keeps every trade as a separate position; a netting account merges them. How each mode works, what locking costs, and Close By.

Piotr NiemidomskiCo-Founder & COO, Vanto
September 13, 202610 min read

Educational content. This article explains the hedging and netting position accounting modes in MetaTrader 5. It does not constitute investment advice or a trading recommendation. CFD trading carries significant risk of loss and may not be suitable for all investors.

Open a buy on EUR/USD, then open a sell of the same size, and one of two things happens in MetaTrader 5. Either the account now shows two positions, one long and one short, both open, or it shows none, because the sell closed the buy. Which of the two depends on a setting the trader does not choose in the platform: the account's position accounting mode, hedging or netting.

This article explains both modes, sets out how a new trade behaves in each, looks at what a locked buy-and-sell pair actually costs using published swap data, describes the Close By operation, and covers what the mode means for margin, stop-out and Expert Advisors. For the mechanics of swap itself, see what is swap in trading.

What Is the Difference Between Hedging and Netting in MT5?

In netting mode an MT5 account can hold only one position per symbol, and every new trade on that symbol is added to or subtracted from it; in hedging mode every trade opens its own position, so the account can hold several positions on one symbol, including a buy and a sell at the same time.

Situation Netting account Hedging account
Buy 1 lot, then buy 1 lot One position of 2 lots at an averaged price Two separate 1-lot long positions
Buy 1 lot, then sell 1 lot Position closed, no position left One long and one short position, both open
Buy 1 lot, then sell 3 lots Position reversed to 2 lots short One 1-lot long and one 3-lot short position
Stop loss and take profit One set for the combined position One set per position
Closing Reduce or close the single position Close a chosen position, or two opposite ones by Close By

Source: MetaTrader 5 Help, Trading Operations, and MetaTrader 5 build 1325 release notes.

How the Netting Mode Works

Netting mode keeps a single net position per symbol, so a trade in the same direction increases it, a smaller opposite trade reduces it, an equal opposite trade closes it, and a larger opposite trade reverses it.

The position has one volume, one direction and one open price, recalculated as an average when volume is added. This is how exchange-traded markets are normally recorded, where an account's exposure to a contract is simply its net holding, and it is the mode MetaTrader 5 was built with. A netting account cannot hold offsetting positions on the same symbol because, by definition, offsetting trades cancel out. Exposure to opposite directions is still possible across different but related symbols, such as a long on one index and a short on another.

How the Hedging Mode Works

Hedging mode records every executed trade as a separate position with its own volume, open price, stop loss and take profit, so opposite positions on the same symbol can be open simultaneously.

Each position is managed independently. Closing one does not affect the others, and each can be closed in full or in part. The mode is the one that retail forex traders coming from MetaTrader 4 are used to, where multiple positions per symbol were always allowed, and it is the reason MetaQuotes added it: the build 1325 release notes describe the hedging option as bringing to MT5 a capability previously supported only in MetaTrader 4.

Vanto trading accounts on MT5 use hedging mode, so a buy and a sell on the same symbol can be held at the same time.

Who Sets the Mode

The position accounting mode is set by the broker at the level of each trading account, and it is displayed in the terminal window header and in the Journal when the account connects.

It is not a switch in the order window. Brokers typically offer hedging and netting through different account groups, and a trader who needs the other mode opens a separate account configured for it rather than changing an existing one. A demo account created from the terminal has an option to choose hedging when it is opened. Some jurisdictions restrict the practice for retail forex: in the United States, NFA rules prohibit holding offsetting positions in the same currency pair in one account, which is why US-regulated forex accounts operate on a netting, first-in-first-out basis.

What a Locked Position Costs

A buy and a sell of equal volume on the same symbol, often called a locked or hedged position, freezes the combined profit or loss from price movement but continues to incur costs: each leg pays its own swap every night, and the spread is paid on every opening and closing trade.

Holding both legs does not cancel their financing, because a long and a short swap are two different published figures rather than one figure with two signs. Their sum is almost always negative. Using the swaps Vanto published on 13 September 2026:

Symbol Long swap Short swap Net for 1 lot long + 1 lot short, per night
EURUSD -9.84 +4.14 -5.70
XAUUSD -63.93 +29.15 -34.78
USDCNH +23.14 -75.57 -52.43

Source: Vanto calculator data, snapshot 2026-09-13, in the published swap units for each symbol. On the triple swap day the charge is booked three times.

The negative sum is not a fee added for hedging. It is the part of the swap that is charged on both sides of any position, which why exotic currency pairs cost more to hold overnight shows can be read directly from the two published figures. A single position pays it together with the interest rate differential; a locked pair isolates it and pays it twice over. On the weekly triple swap day the charge is tripled.

The spread adds a second cost. Opening the buy crosses the spread once and opening the sell crosses it again; closing both separately crosses it twice more. A locked position therefore has a known, steady cost and no price exposure, which is the reason it is described as a way to pause exposure rather than as a way to hold it.

Closing Two Opposite Positions With Close By

Close By is an MT5 operation, available in hedging accounts, that closes a long and a short position on the same symbol against each other in a single operation, so that one spread is saved compared with closing each position separately.

When two opposite positions are closed one at a time, the long is closed at the Bid and the short at the Ask, and the spread is paid on both. Close By pairs them: the positions close against each other at their open prices, and if the volumes differ, the larger position remains open with the difference. The build 1325 release notes describe the saving as one spread. Close By is found in the position's context menu under Close By, and only positions on the same symbol and in opposite directions can be paired.

Margin, Stop-Out and Hedged Positions

In a hedging account the margin required for opposite positions on the same symbol is set by the broker per instrument through a separate hedged-margin parameter, so it can be lower than the sum of margin for the two legs, and the figure for a given instrument is shown in its MT5 symbol specification.

MT5 stores this value as the symbol's hedged margin, defined in the release notes as the contract size or margin for one lot of oppositely directed positions on the same symbol. Because it is a broker setting per instrument, the symbol specification in the terminal is the authoritative source, and it can change.

A locked position is not immune to a margin call or stop-out. The combined price result is frozen, but equity still falls by the nightly swap, and each leg is valued at the price at which it would close, so a widening spread at rollover or around news lowers equity temporarily as well. An account that is already close to its limits can reach them without any change in the mid price. The levels and what triggers them are covered in what is stop-out level in trading and what is margin in trading.

Hedging Mode and Expert Advisors

An Expert Advisor written for one accounting mode can behave incorrectly in the other, because in hedging mode a symbol can have several position tickets while in netting mode it has at most one.

Code that assumes one position per symbol, for example by selecting the position by symbol name, finds only one of several positions in a hedging account and manages it as if it were the whole exposure. Code written for netting that closes a position by sending an opposite trade does not close anything in a hedging account: it opens a second, opposite position instead. The account mode can be read by a program at start-up, and robust Expert Advisors check it rather than assume it.

Frequently Asked Questions

Can I buy and sell the same symbol at the same time in MT5?

Only in a hedging account. In hedging mode every trade is a separate position, so a buy and a sell on the same symbol can both be open. In netting mode an opposite trade reduces or closes the existing position instead.

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

The mode is shown in the terminal window header next to the account details and is recorded in the Journal tab when the account connects. It is set by the broker for the account and cannot be changed from the platform.

Is hedging allowed on Vanto MT5 accounts?

Yes. Vanto MT5 trading accounts use hedging mode, so opposite positions on the same symbol can be held at the same time. Automated strategies through Expert Advisors are also allowed.

Does a hedged position still pay swap?

Yes. Each position pays or receives its own swap at every rollover. Because the long and short swaps on an instrument usually sum to a negative number, a locked pair of equal volume is charged every night.

What is Close By in MT5?

Close By closes two opposite positions on the same symbol against each other in one operation. It saves one spread compared with closing the two positions separately.

Why does MT5 close my position when I open a trade in the opposite direction?

Because the account is in netting mode. In netting mode MT5 holds one position per symbol, so an opposite trade of equal volume closes it, and a larger one reverses it.

Trade in Hedging Mode on Vanto

Vanto accounts on MetaTrader 5 use hedging mode, with the full swap, contract size and margin figures for every instrument in the trading calculator and the MT5 symbol specification. The different account types are compared on the account types page, and how pending orders are stored and triggered in either mode is explained in buy limit vs buy stop. A demo account shows how opposite positions and Close By appear in the terminal without risking capital.


Risk warning. Trading securities, futures, options, and contracts for differences are complex financial instruments that require knowledge and understanding. Prices can fluctuate significantly and securities may become valueless. Investors may incur losses exceeding the potential for profits. Trading on margin can result in losses greater than the amount initially deposited. Past performance is not necessarily a guide to future performance. The information in this article is for educational purposes only and does not constitute investment advice, a recommendation, or an offer to buy or sell any financial instrument. Consider whether CFD trading is appropriate for your circumstances and seek independent advice if necessary.

Share this article
Get Started

Ready to start trading?

Open an MT5 account with Vanto and start trading forex, indices, commodities, and cryptocurrencies.

Multi-asset CFDsAutomated onboardingSTP ExecutionMulti-channel support