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

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.

SituationFree hedging accountFIFO-style account
Close one of three buysYou choose which oneThe oldest is closed first
Open a sell while holding a buyCreates a second positionMay be rejected or may reduce the buy
Layered take profitEach layer works aloneLayers close in order of entry
Reading historyTickets match your clicksTickets 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

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

Frequently asked questions

What is the FIFO rule in MT5?
A broker policy under which positions in the same symbol are closed in the order they were opened. It is not a default platform setting.
Can I hedge on a FIFO account?
Often not. Some brokers reject an opposite order in the same symbol or use it to reduce the existing position.
Why did a different ticket close?
Under FIFO the oldest position closes first. Check the broker’s terms and the Journal tab messages.
Does the journal app know the policy?
No. It records closed positions only. Write the policy in your notes.
Is FIFO the same as netting?
No. Netting merges all deals in a symbol into one position, while FIFO is an order in which separate positions are closed.

Related guides

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