MT5 Close By explained: how it looks in your trade history
Closing two opposite positions against each other: why traders do it, how the history shows it, and how to journal the pair.
On a hedging account, MetaTrader 5 lets you hold a buy and a sell in the same symbol at the same time. It also gives you a way to close two opposite positions against each other instead of closing each one separately. The function is usually called Close By. It is easy to miss in the platform and easy to misread in the history, because the result is not one clean exit deal but a pair of linked records. This page explains what Close By is, why traders use it, how it can look in the history, and how to keep your journal honest when it was used.
What Close By does
When you hold two opposite positions in the same symbol on a hedging account, for example a buy of 0.10 lots and a sell of 0.10 lots, you can ask the platform to close one by the other. Instead of sending two market orders and paying the spread twice, the broker nets the two positions against each other. In the terminal this is normally offered from the context menu of a position in the Trade tab, with a dialog asking which opposite position to use. Menu wording can differ between builds and brokers, so check your own terminal before relying on any name given here.
The reason some traders like it is cost. Closing two opposite positions with two market orders means two exits, each at the current price, each potentially paying the spread. Closing one by the other can avoid that, because no new market price is involved. Whether your broker charges a commission on a close-by deal, or treats it differently, depends on the broker. Read the account specification, not a forum post.
| Situation | Two market closes | Close By |
|---|---|---|
| Price used for exit | The current market price for each | The opening prices of the two positions are matched against each other |
| Spread paid on exit | Usually once for each close | Depends on the broker; ask or test on demo |
| Number of exit records | Two ordinary exit deals | A linked pair, often with a comment marking the close-by |
| Account type needed | Any | Hedging only; netting accounts merge positions anyway |
If you are not sure whether your account is hedging or netting, the page on hedging vs netting in trade history shows how to tell and what each one does to your records.
How it can look in the history
Because the two positions are closed against each other, the history may show an exit deal for each side, often carrying a comment that refers to the other position, and the profit may appear on one record while the other shows little or none. The details depend on the platform build and on the broker’s server. That is why you should never assume the layout from a description. Open the Deals tab of the History, find the positions by their ticket numbers, and read the rows yourself.
- Look for two exit deals close together in time with the same symbol and opposite directions.
- Check the comment field of each: a close-by is often marked there, though the wording is set by the server.
- Compare the profit, commission and swap columns of both rows; one may carry the whole result.
- Use the position ticket, not the time, to link each exit to its entry. The page on deal, order and position IDs explains the three numbers.
Reading the rows this way is slower than reading a normal trade, but it is the only reliable method. A close-by is not an error; it is a platform feature, and a good journal should show it as what it is.
What it does to your journal figures
AI Trading Journal reads closed positions from MetaTrader 5 and creates one entry per closed position, dated by the last exit on the broker’s server clock, with the result calculated as profit plus commission plus swap. When two positions were closed by each other, each is still a closed position, so each gets its own entry. That means one entry might show a gain and its partner a loss, and the pair together is the real result of the hedge. If you look at only one of them, the figure will mislead you.
The practical answer is to tag both entries the same way, for example close-by, and to write one note on either of them explaining the idea behind the hedge. Filter by the tag later and add the two results together to see the net outcome. The app does not link the pair for you automatically; that grouping is something you do with the tag and the notes. Tagging is covered in how to tag trades in a trading journal.
Why this matters for statistics
Win rate and average win are sensitive to how pairs are counted. Imagine a hedge where the buy closes for a profit and the sell closes for a loss of nearly the same size. Counted as two separate trades, you get one winner and one loser. Counted as one hedge, you get a result close to zero and one decision. Neither view is wrong, but you must pick one and use it consistently, or the statistics will drift. If you use hedges only now and then, an easy rule is to tag them and exclude the tag when you look at the plain win rate, then look at the tagged group on its own.
A worked example (hypothetical)
A trader holds a buy of 0.10 lots opened earlier in the day and opens a sell of 0.10 lots in the same symbol to protect against a news release. After the release the trader decides to end both. Instead of two market closes, the trader uses Close By. The history shows two exit records minutes apart. The journal shows two entries with a combined result of a small negative amount, which is mostly the spread paid when the hedge was opened plus any swap. The trader tags both with close-by and writes a note: hedged before news, closed after volatility settled. Later, filtering the tag shows how often hedges ended up costing more than they saved. The numbers here are invented for illustration only.
Limits and cautions
- Behaviour of Close By, including cost, differs by broker; this page cannot state your broker’s rules.
- The app does not record the intent behind a hedge, only the closed positions, so your notes carry the reasoning.
- The app is read-only. It never places, modifies or closes a trade, and it cannot perform a Close By for you.
- Hedging itself may be restricted by some prop firms or regions; check the rules that apply to you.
- Nothing here is trading advice.
If you also want to know what a normal partial exit looks like, read partial closes in MT5 history, and for the cost side of any exit see trading costs in trade history.
Frequently asked questions
What is Close By in MT5?
Is Close By available on netting accounts?
How does a close-by appear in the history?
Does the journal app group the two entries?
Can the app perform a Close By for me?
Related guides
- A local trading journal for MT5
- P&L calendar for MT5
- Trade notes, ratings and screenshots
- Trading progress and goals
- Back up your journal and move it to a new PC
- An offline trading journal for Windows
- How to set monthly trading goals
- Import your whole MT5 history
- How to tag trades
- Trade screenshots for your journal
- All trading journal comparisons
Tag hedges and review the pair in a local journal: free for 7 days
Free for 7 days, no card required. After that, a one-time $19.99 purchase. No subscription. Also on the Microsoft Store.
One-time $19.99, no monthly fee · your MT5 login never leaves your PC · trades go into your own journal on your PC, not through our servers.
Start free 7-day trial