MT5 FIFO rule: why the oldest position can close first
Some accounts close positions in the order they were opened and reject opposite orders. See how to spot it and how to keep your records clear.
Some MetaTrader 5 brokers, especially those that serve clients under rules that require positions to be closed in the order they were opened, apply a first-in first-out policy. If your account is one of them, you can see surprising behaviour: you click close on a position and the platform closes a different, older one, or refuses to open an opposite position. This page explains the idea, how it differs from the free choice that a typical hedging account gives, how to recognise it from your history and what to note in a journal so that your records stay readable.
What first-in first-out means
Under a first-in first-out rule, when you hold several positions in the same symbol and direction, closing volume applies to the oldest one first. If you have three buy positions of different sizes opened at different times, a request to close part of your exposure reduces the earliest position before the later ones. Some brokers also prohibit holding a buy and a sell in the same symbol at the same time, so an opposite order closes or reduces the existing position instead of creating a lock.
This is a rule of the broker or its regulator, not a general feature of the platform. The terminal can run accounts in hedging mode, where each position is independent, and in netting mode, where all deals in a symbol merge into one position. A FIFO policy is an extra restriction layered on top, and how it is enforced depends on the broker’s setup. Compare the explanation in hedging versus netting with the terms of your account type, described in account types and your trade history.
How you notice it
- A close order on a specific position ends up affecting an older one, so the ticket you expected to see in the history is not the one that closed.
- An attempt to open an opposite position in the same symbol is rejected, with a message in the Journal tab or the Experts tab; see the Journal tab explained.
- Positions of the same symbol close in the order they were opened, whatever you intended.
- The broker’s account page or terms mention FIFO, or a rule about not holding opposite positions.
What it does to a layered strategy
Traders who scale into a trade with several entries often plan to take profit on one layer and leave the others. Under FIFO the layer that closes is the oldest, which is not necessarily the one with the best price. The realised profit then depends on the order of entry, not on the layer you wanted to sell. The mechanics of layered trades are in scaling in and out. A close-by operation, covered in close by, may also be restricted or unavailable on such accounts.
| Situation | Free hedging account | FIFO-style account |
|---|---|---|
| Close one of three buys | You choose which one | The oldest is closed first |
| Open a sell while holding a buy | Creates a second position | May be rejected or may reduce the buy |
| Layered take profit | Each layer works alone | Layers close in order of entry |
| Reading history | Tickets match your clicks | Tickets may not match what you clicked |
A worked example (hypothetical)
A trader buys 0.1 lot at 100.00, 0.1 lot at 102.00 and 0.1 lot at 104.00. The price reaches 105.00 and the trader closes the third position, intending to bank the smallest gain and hold the cheaper ones. Under a FIFO policy the platform closes the first position instead, with a larger gain than expected but leaving the highest entry open. The total profit at that moment is the same arithmetic result as the closing price and volume suggest, yet the open exposure is different. The prices are invented. The lesson is to test your broker’s behaviour with the smallest volume before planning around it.
How to keep your records readable
- Write the broker policy at the top of your review notes, so that later you remember why a ticket closed.
- Note when a close happened in a different order from the one you intended; that is a data point about the account, not a mistake in your journal.
- Group your layers into one trade idea in your own notes, since the platform reports separate positions.
- If a partial closure was applied to an older position, the profit lands on that position; compare the discussion in partial closes in history.
AI Trading Journal, a Windows app for MetaTrader 5 only, creates one entry per closed position and records the result as profit plus commission plus swap. It does not record which position you intended to close, since it reads only the closed history. The app is read-only, so it never places, modifies or closes a trade, and the journal is a file on your own PC. Use the notes field to record what you intended.
Limits and cautions
- Whether your broker enforces FIFO and how is a matter for the broker’s terms; ask support if the behaviour is unclear.
- This page does not say that any particular broker or country requires it.
- The numbers in the example are invented and not advice.
Frequently asked questions
What is the FIFO rule in MT5?
Can I hedge on a FIFO account?
Why did a different ticket close?
Does the journal app know the policy?
Is FIFO the same as netting?
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
Record what you meant to close: 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