Hedging vs netting in MT5: what is the difference?
Definition Hedging and netting are the two position accounting systems in MetaTrader 5: a hedging account can hold several positions on one symbol, including opposite ones, while a netting account keeps one net position per symbol.
MetaTrader 5 accounts use one of two position accounting systems. A hedging account can hold several positions on the same symbol, including a buy and a sell at the same time; a netting account keeps one position per symbol, and every new deal adds to it, reduces it or reverses it.
How each system works
MetaQuotes’ position accounting help defines both, and states that the system “depends on the account and is set by the broker”.
- Netting. “You can have only one common position for a symbol at the same time.” A deal in the same direction increases its volume; an opposite deal decreases it, closes it, or reverses it when the opposite deal is larger.
- Hedging. “You can have multiple open positions of one and the same symbol, including opposite positions.” Each new order opens a separate position with its own stop loss and take profit, and a close applies to one chosen position.
Worked example: the same three orders
On the hedging account, the buy and the first sell partly offset each other while both stay open. Each leg has its own spread cost and swap. MT5’s Close By operation, available only on hedging accounts, closes two opposite positions against each other and saves one spread (MT5 help). Opposite positions can also need less margin than the same volume in one direction, if the broker sets a reduced “hedged margin” for the symbol (margin help); the margin calculator covers the basic formula.
In the US, NFA Compliance Rule 2-43(b) requires forex dealer members to offset positions first-in, first-out rather than carry opposite positions in a customer account.
How to check your account in MT5
- Title bar and Journal. MetaQuotes says the accounting system is shown in the terminal’s window title and in the Journal tab of the Toolbox (Ctrl+T) (MQL5 article).
- Two test orders. On the account you want to check, open two minimum-size positions in the same direction on one symbol. Two rows in the Trade tab mean hedging; one combined row means netting. On a live account this costs two spreads, so the title bar is the cheaper check.
- In MQL5.
AccountInfoInteger(ACCOUNT_MARGIN_MODE)returnsACCOUNT_MARGIN_MODE_RETAIL_HEDGING,ACCOUNT_MARGIN_MODE_RETAIL_NETTINGorACCOUNT_MARGIN_MODE_EXCHANGE(MQL5 docs).
When you open a demo account, the Use hedge in trading option picks hedging; unticked, the account uses netting (MT5 help).
Common mistakes
Testing on one system and trading on the other. An Expert Advisor written for hedging, with several positions per pair, behaves differently on netting, and the reverse. A demo test says more when the demo uses the same system as the live account; how to test an EA on a demo account lists what else to match, and why an EA is not taking trades covers the other differences between demo and live.
Trading by hand next to an EA on a netting account. There is only one position per symbol, so a manual trade on the EA’s pair changes the EA’s position instead of opening a separate one. The magic number cannot keep them apart.
Hedging, netting and PipWarden
PipWarden’s EA works on both systems. By default it holds at most one position per pair, so the difference mostly shows in partial closes: on a hedging account the EA closes part of the position, and on a netting account it sends an opposite deal carrying the bot’s magic number and restores the stop loss and take profit if that deal changed them.
Frequently asked questions
Can I switch my MT5 account from netting to hedging?
Is hedging allowed for US forex accounts?
Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.