What the account mode is
MetaTrader 5 supports different ways of recording positions. A position is your open exposure in a symbol, such as a buy on EURUSD that has not been closed yet. The account mode decides how the platform combines your trades into positions.
For retail forex and CFD accounts there are two modes:
- Netting. Each symbol can have only a single open position at a time.
- Hedging. Each symbol can have many open positions at the same time, including buys and sells side by side.
The mode is set on the trading server when the account is created. You cannot switch it inside the terminal. If you need the other mode, you need a different account. Check which mode your account uses before you trade. Our pages on MetaTrader 5 and MT4 vs MT5 cover the platform in general.
Ready to try it on a real or demo account?
Partner link · trading carries a high risk of loss
How positions are recorded
Netting account
On an MT5 netting account, every deal in a symbol changes the same position:
- A buy added to an existing buy increases the volume. The position's open price becomes the volume-weighted average of the deals.
- A sell smaller than the open buy reduces the volume. The position stays a buy.
- A sell equal to the open buy closes the position.
- A sell larger than the open buy closes the buy and opens a sell with the remaining volume. This is called a reversal.
Stop loss and take profit belong to the whole position, not to separate deals. For how these levels work, see stop loss and take profit.
Hedging account
On an MT5 hedging account, every market order or triggered pending order opens a new position with its own ticket number, open price, stop loss and take profit. The Trade tab of the Toolbox shows each position on its own line.
An opposite order does not close anything by itself. If you hold a buy and send a sell for the same symbol, you end up holding a buy and a sell at the same time. To close a position you close that specific ticket. Holding opposite positions on the same symbol is what "hedging account" means in MT5.
Hedging accounts also offer Close By. In the order window of an open position, you choose this operation and select an opposite position on the same symbol. The platform closes them against each other. If the volumes differ, the remainder stays open.
Side-by-side comparison
| Point | Netting | Hedging |
|---|---|---|
| Positions per symbol | A single position | Many positions |
| Opposite order | Reduces, closes or reverses the position | Opens a separate opposite position |
| Open price | Averaged across deals | Kept per position |
| Stop loss / take profit | Per symbol position | Per ticket |
| Close By | Not used | Available |
| Typical origin | Exchange-style accounting | MT4-style accounting |
What opposite positions really do
A buy and a sell of equal volume on a hedging account lock the floating result: further price moves change one side's profit and the other side's loss by similar amounts. The trade is not risk-free:
- You pay the spread on each position, and possibly commission.
- Swap is charged or credited on each position held overnight. See swap fees.
- The spread can widen, for example around news or at the daily rollover. That can move equity and margin level even when the positions are locked.
- Unlocking means closing a side at some point. The result then depends on where the price goes next.
On a netting account the same pair of orders simply leaves you flat. That is often a clearer picture of your actual exposure.
Margin implications
Margin is the amount the platform sets aside to keep positions open. In netting mode, margin is calculated on the single net position. In hedging mode, the platform calculates margin for opposite positions using the symbol's hedged margin setting. Depending on the symbol, this can be lower than the margin for both sides counted separately.
You can find the value in the symbol's specification window. See contract specifications. Do not assume locked positions are protected from a stop-out, which is the forced closing of positions when the margin level falls too low. Leveraged CFD and forex trading can lose money fast in either mode. Read risk management before you trade with real money.
Implications for Expert Advisors
Expert Advisors are automated programs written in MQL5, and they must match the account mode:
- Grid, martingale and "lock" EAs open several positions on a symbol. They need a hedging account. On a netting account their orders merge into a single position, and the logic breaks.
- EAs written for netting often select the position by symbol name. On a hedging account they may see only some of the open tickets and manage them wrongly.
- Well-written code reads the account property ACCOUNT_MARGIN_MODE and loops through positions by ticket. See MQL4 and MQL5.
- The strategy tester uses the mode of the account you are logged into. Test on the same mode you plan to trade.
Code ported from MT4 usually assumes hedging, because MT4 records every order separately.
A note for readers in Pakistan
Before you use any offshore platform, note that per the SECP, offshore platforms have no Pakistani licence or oversight and offer no legal protection or recourse. Read law and regulators for the wider picture.
Frequent questions
What does hedging account mean in MT5?
It is an account mode in which you can hold several positions on the same symbol, including a buy and a sell at the same time. Each position has its own ticket.
Can I change my MT5 account from netting to hedging?
No. The mode is fixed on the server when the account is created. You would need to open a new account with the other mode.
What happens if I sell on a netting account while holding a buy?
The sell reduces the buy. If the volumes are equal, the position closes. If the sell is larger, the position reverses into a sell.
Is hedging safer than netting?
No. Locked positions still cost spread and swap, and they still use margin. Your account can still reach stop-out.
Which mode should my EA use?
Use the mode the EA was written and tested for. Check the developer's notes, and test it on a demo account with the same mode first.
