
Close By is a MetaTrader 5 operation that closes two opposite positions on the same symbol — a buy and a sell — against each other in a single operation. It works only on hedging accounts and saves one spread compared with closing the two positions separately.
When it is available
Close By works only in the hedging position accounting system, where you can hold several positions on one symbol, including opposite ones. ABF Trade accounts allow hedging.
What it changes
When you close two positions separately, you pay the spread twice: the buy position is closed at the Bid price and the sell position at the Ask price. In a Close By operation the open price of the first position is used to close the second one, so one spread is saved.
Close By does not remove the result of the trade. The profit or loss already built into the two open prices stays the same.
In the platform the operation places an order of the close by type, with the tickets of both positions in its comment. The two positions are closed by two out by deals, and the total profit or loss of the operation is shown in one of them.
Steps
- Open the Toolbox (Ctrl+T) and go to the Trade tab.
- Double-click one of the two opposite positions, or right-click it and select Close Position.
- In the Type field select Close By.
- Select the opposite position from the list.
- Click Close.
If the volumes are different
Only one position is left open. Its volume equals the difference between the volumes of the two closed positions. For example, closing a 1.00 lot buy against a 0.40 lot sell leaves a 0.60 lot buy position.
Frequently asked questions
Can I use Close By on a netting account?
No. Close By needs the hedging position accounting system, where one symbol can have several positions, including opposite ones. ABF Trade accounts allow hedging.
Does Close By change my profit or loss?
No. The profit or loss built into the two open prices stays the same. Close By only saves the spread you would pay when closing the second position separately.
How does Close By appear in my trade history?
As an order of the close by type and two out by deals. The total profit or loss of the operation is shown in one of the two deals.
Sources
- MetaTrader 5 Help: Executing Trades: Close By
- MetaTrader 5 Help: Basic Principles
- ABF Trade: Trading Account Types
66.7% of retail investor accounts lose money when trading CFDs with this provider. Assess if you're comfortable with this level of risk.

