AlgoWay Blog

Guides, manuals and platform references.

Core
JSON & Alerts
MT5 / Expert Advisors
Errors
Integrations
Other Publications
AlgoWay Strategy Lab

MT5 Netting vs Hedging: What Opposite Trades Really Do

AlgoWay trading automation

You buy 1.00 lot, then sell 0.40 lot of the same symbol. One MT5 account shows a remaining buy of 0.60 lot. Another shows a buy of 1.00 and a sell of 0.40. Neither result, by itself, proves the platform made a mistake.

On a netting account, an opposite deal reduces, closes or reverses the single position for that symbol. On a hedging account, a new opposite entry opens a separate position. The broker determines the account's position accounting system. MetaTrader documents both in its trading principles.

Work out the position before sending the order

The table below is position arithmetic, not a trading recommendation or a test result. Each row starts independently with one buy position of 1.00 lot. Assume the new sell entry fills completely, no other order intervenes, and all trades use the same symbol and contract size.

New sell entryNetting account afterwardsHedging account afterwards
0.40 lotOne buy position of 0.60 lotBuy 1.00 plus sell 0.40
1.00 lotNo open position in this symbolBuy 1.00 plus sell 1.00
1.40 lotsOne sell position of 0.40 lotBuy 1.00 plus sell 1.40

For netting, signed volume is a useful scratchpad: +1.00 minus 1.40 equals -0.40. The minus sign means a remaining short. For hedging, that same arithmetic describes net directional volume, but it does not describe the number of open positions.

In the middle row, the hedging account has zero net directional volume and 2.00 lots of gross open volume. Two open positions have not become two closed positions merely because the arithmetic cancels. If one side later closes, the other remains. A balanced bookshelf still contains books.

Partial close means selecting what to close

On a hedging account, do not use a fresh Sell entry as shorthand for reducing a Buy. In MT5's Trade tab, select the intended position and use Close Position. To close only part, enter the closing volume in the Volume field of the close dialog. Follow the execution procedure shown for that account. This is the distinction in MetaTrader's position-closing instructions.

For example, closing 0.40 of the selected 1.00-lot buy should leave 0.60 of that buy after a complete fill. Opening a new 0.40-lot sell instead leaves the original buy intact. For automation, write the desired state explicitly: “reduce this buy to 0.60” is a different requirement from “open a sell of 0.40.” Check the tool's documented close operation before translating that requirement into a message.

A pending opposite entry needs the same care. On a netting account, the opposite deal can reduce the existing position when it executes. On a hedging account, an ordinary new opposite entry creates another position. A pending order is not automatically a partial take-profit merely because you placed its price where you hoped to exit.

Already holding both sides?

MT5 also documents Close By for closing opposite positions in the same symbol. With unequal volumes, the remaining position has the difference in volume and the larger side's direction. This is a specific closing operation, not another fresh entry. Where the operation is available, inspect the selected positions and volumes before confirming it. See the official Close By explanation.

Check the account, then the automation rule

Ask the broker which accounting system the particular account uses. An MT5 installation alone does not answer that question. On a demo account with the same accounting setup, record an initial position, submit one small operation, then compare the resulting position list and trade history with the intended state. Repeat the check for an explicit partial close. This is a proposed verification procedure, not a claim that we ran it.

Keep account accounting separate from a connector's signal-handling policy. For the latter, consult AlgoWay's guide to Hedge, Reverse, Opposite and other trade modes. A mode label is not enough to predict the final account state without knowing which operation is sent and which accounting system receives it.

Before enabling a strategy, write down three things: the position you expect before the signal, whether the instruction opens or closes, and the positions you expect afterwards. Those three lines catch an expensive vocabulary mistake while it is still only a vocabulary mistake.