What are "close by" and "multiple close by" on XM MT4 and MT5?

On MT4 and MT5, Close By is a built-in order action that closes two opposite positions on the same symbol against each other. Instead of closing each trade separately at the current bid/ask, the platform offsets one trade with the other. When the two positions have different sizes, the platform closes the overlapped lot size and leaves a residual position equal to the difference in volume. In practical terms, this is used when you run hedged positions (for example, long EURUSD and short EURUSD at the same time).

Multiple Close By extends the same idea. It lets you pair off and close all hedged positions for a symbol in one go, saving time when you have several buys and sells that offset each other.

XM allows hedging on MT4 and MT5 accounts, so you can hold buy and sell positions on the same instrument in one account and use these functions as part of your position management. XM does not allow hedging between different accounts. Keep all hedged legs in the same trading account.

Invest in Forex with XM

Why Forex traders use Close By

  • Cost control on hedges. When you close two opposite trades separately, each closure is hit by the spread at the moment of exit. Close By offsets one leg against the other, which avoids paying the spread twice on the overlapped volume. That is the core reason hedged traders use it.
  • Cleaner position book. Hedging strategies can produce multiple legs as you scale in and out. Pairing them off with Close By or Multiple Close By quickly nets the book back to your intended exposure without clicking through every ticket.
  • Deterministic offset. The platform uses the two open positions to settle each other. You are not dependent on a fresh market fill for each side; the system nets the positions based on the tickets you choose. In volatile conditions, this can be more predictable than racing to close two legs one by one.

Open an account with XM

How Close By works under the hood (MT4/MT5)

  • Same symbol, opposite direction. You can only Close By on the same instrument (e.g., EURUSD vs. EURUSD) and only with opposite directions (buy vs. sell).
  • Volume logic. If you have 0.70 lots long and 0.50 lots short, the platform closes 0.50 vs 0.50 and leaves 0.20 long open. The remaining trade keeps the direction and the open price of the larger leg.
  • Single-action netting. The mechanism is implemented by the platform’s trade engine (on MT4 via OrderCloseBy and on MT5 through the “Close By” operation). You pick the two tickets; the platform offsets them and writes appropriate closure records to the history.
  • Spread economics. Because the closure is an offset between two existing positions, the overlapped volume avoids being closed through both sides of the market at the current spread. That’s why it’s preferred when unwinding hedges.

Invest in Forex with XM

What “Multiple Close By” does that “Close By” doesn’t

Close By pairs one position with one opposite position. You choose which two to offset.

Multiple Close By scans your open tickets on that symbol and closes all hedged portions in one action. It reduces click-work when you have many partial buys and sells that net out. Any unhedged remainder stays open exactly like with standard Close By.

Open an account with XM

Concrete scenarios (lot-by-lot)

Scenario A — One-to-one hedge
Long EURUSD 1.00 lot @ 1.09000
Short EURUSD 1.00 lot @ 1.09500
Use Close By on these two tickets. The platform offsets 1.00 vs 1.00. Both positions are closed against each other in one action. No residual remains. The history shows a Close By operation on both tickets.
Scenario B — Unequal sizes
Long EURUSD 1.30 lots @ 1.09000
Short EURUSD 0.80 lots @ 1.09500
Close By offsets 0.80 vs 0.80. You are left long 0.50 lots at the original price of the larger leg. That 0.50 remains in the book until you close it later.
Scenario C — Many small tickets
Longs: 0.40 + 0.20 + 0.10 lots
Shorts: 0.30 + 0.30 lots
Use Multiple Close By. MT4/MT5 pairs off the hedged portions across those tickets automatically. After the action completes, you will have 0.10 lots long left open (since total longs 0.70 minus total shorts 0.60 = 0.10).

Invest in Forex with XM

Step-by-step on MT4 (Windows/macOS via emulator)

  • Close By (single pair):
    • In the Terminal → Trade tab, double-click the position you want to offset.
    • In the order window, change Type to Close By.
    • Pick the opposite ticket from the list.
    • Click Close to execute.
  • Multiple Close By (all hedged portions on the symbol):
    • From the same order window for the symbol, switch Type to Multiple Close By.
    • Review the listed opposite tickets.
    • Click Close to offset all hedged volumes in a single action.

Under the surface, MT4 calls OrderCloseBy to pair tickets. You don’t need to script anything; it’s native to the platform.

Open an account with XM

Step-by-step on MT5 (desktop and mobile)

  • MT5 desktop:
    • Open Toolbox → Trade, double-click a hedged position.
    • In the order dialog, select Close By to pair it, or Multiple Close By to net all hedged tickets for the symbol.
    • Confirm.
  • MT5 mobile (iOS/Android):
    • On the trade screen, tap the position → tap Close By to pair with an opposite ticket.
    • If available in your app build, use Multiple Close By to offset all hedged parts for the symbol. The platform handles leftover volume automatically.

Invest in Forex with XM

What Close By does not do

  • It does not close same-direction stacks. If you have three longs and no shorts, Close By is irrelevant. You must close them manually or use scripts/EAs for batch actions.
  • It does not work across symbols. EURUSD can only Close By against EURUSD. Cross-symbol netting is not supported.
  • It requires hedging mode. The account/platform must support holding buys and sells together on the same instrument. XM accounts allow hedging; use that single account, not two different accounts.

Open an account with XM

Cost mechanics: why traders prefer Close By on hedges

When you close two opposite positions separately, each leg is exposed to the current bid/ask. That means two touches of spread on the overlapped volume.

With Close By, the platform offsets the two positions against each other. The hedged portion is settled internally, which avoids paying the spread twice on that overlapped size. For hedgers who frequently rebalance, this is a direct and measurable cost benefit.

On MT4 this is implemented via OrderCloseBy and on MT5 via the Close By operation. You select the tickets; the trade engine creates closure records accordingly.

Use Close By and Multiple Close By only when you actually hold opposite positions on the same instrument. If your exposure is one-sided, these actions do nothing and you should use standard close or partial close instead.

Invest in Forex with XM

XM-specific guardrails for hedged positions

  • Hedging is allowed on MT4 and MT5 across XM account types, which is the prerequisite for Close By usage.
  • No inter-account hedging. Do not open a buy in one XM account and a sell in another with the intention to offset them between accounts. XM disallows cross-account hedging; keep your hedge within a single account.

Open an account with XM

Practical workflow for Forex hedgers on MT4/MT5 (XM)

  • Open your primary leg with your normal entry logic (e.g., long EURUSD).
  • Add a hedge if your plan uses opposing exposure (e.g., short EURUSD as a temporary offset).
  • When you decide to unwind, use Close By to pair a single buy with a single sell, or Multiple Close By to net many small legs together.
  • If there is any residual (unequal sizes), manage it as a normal open trade—move stops, scale out, or close as needed.

Invest in Forex with XM

Tips to avoid common mistakes

  • Match the symbol exactly. EURUSD (standard) vs. EURUSDmicro or a symbol with suffixes (e.g., “.pro”) won’t pair. Select tickets that exactly match.
  • Work from the position window. Always start Close By from the actual ticket. This ensures the platform loads the appropriate opposite tickets for that instrument.
  • Use Multiple Close By when your book is cluttered. If you have many partial tickets in both directions on one Forex pair, Multiple Close By is faster and less error-prone than picking pairs one by one.
  • Don’t expect it to close everything if you’re one-sided. If your exposure is unidirectional, Close By has nothing to offset; it won’t help.

Open an account with XM

Frequently asked questions (focused)

Can I Close By on MT4 and MT5 with XM?
Yes. XM accounts support hedging, and MT4/MT5 natively provide Close By and Multiple Close By for hedged positions.
What happens to partial mismatches?
Only the overlapped lots are offset. The extra volume from the larger position stays open with the same open price and direction as before.
Is Close By cheaper than closing both legs manually?
For the overlapped size, Close By avoids paying the spread twice. That’s the main cost advantage for hedgers who rebalance often.
Does Multiple Close By pair everything correctly by itself?
Yes. The platform enumerates all opposite tickets for the symbol and offsets the hedged portions in a single action. Any remainder stays open.
Can I use Close By for positions on different symbols (e.g., EURUSD vs. GBPUSD)?
No. Close By requires the same symbol and opposite directions.
Can I hedge across two XM accounts and then Close By?
No. XM allows hedging within a single account but not between accounts. Keep your buy and sell in the same account if you plan to use Close By.

Invest in Forex with XM

A precise mental model for Forex traders

Think of Close By as netting two tickets of the same pair. You pick the pair of opposite trades; the platform does a controlled offset. The PnL you see is determined by the price difference between the two entries (plus the platform’s settlement rules), and you avoid the double spread hit that comes from closing each ticket separately in the live market. If sizes don’t match, the unpaired tail remains exactly as it was—same entry price, same direction—and you manage it with your usual stops, targets, or partial closes.

Open an account with XM

Quick reference: what to click

Platform Action
MT4 Single pair: Position → Type: Close By → pick opposite ticket → Close. Many tickets on the symbol: Position → Type: Multiple Close By → Close to net all hedged parts.
MT5 Desktop: Position → dialog Close By or Multiple Close By → confirm. Mobile: Position → Close By (pairs) or Multiple Close By (nets all).
  • Close By: offset one buy with one sell on the same symbol.
  • Multiple Close By: offset all hedged tickets for the symbol in one action.
  • Why use them: reduce click-work on hedges and avoid the second spread touch on overlapped volume.
  • When they work: only with opposite positions on the same instrument, inside the same hedging-enabled account.
  • What remains: any unequal lot remainder stays open with its original price and direction.

Invest in Forex with XM

Recent Comments

Check out the 56+ comments!

Mobile Flip Menu

Close Drawer Nav

News & Columns

Promotion & Events

Knowledges & Educations

Pages

SNS

2026 © FXBonus

XM
No rating yet.
No rating yet.
3/5 0