MT5 deal entry types: in, out, in/out and out by explained
Learn what each label in the deals list means, how reversals and close-by appear, and how to turn many rows into one trade.
Open the Deals view of the MetaTrader 5 history and you will see a column that labels each row with something like “in” or “out”. That label is the deal’s entry type, and it is the key to turning a long list of executions into trades you can count, group and review. This page explains the four entry types, how they show up on hedging and netting accounts, how to use them when you copy history into a spreadsheet, and where the labels can mislead you if you take them at face value.
What an entry type describes
Every deal in MetaTrader 5 is a single execution at a price and a volume. The entry type tells you what that execution did to the position it belongs to. An entry deal creates or increases a position. An exit deal reduces or removes it. Two further types cover special cases: a deal that reverses a position and a deal that closes one position against another. The terms come from the platform’s own trading model, which separates orders (instructions), deals (executions) and positions (the running result), as described in deal, order and position IDs.
On screen the label may be spelled differently depending on your terminal language and build, so treat the names below as the idea rather than an exact string, and check your own terminal. In the Python interface the same four values exist as numeric constants, which is how scripts read them; the approach is shown in reading history deals in Python.
The four entry types
| Entry type | Plain meaning | Typical row you will see |
|---|---|---|
| In | Opens a position or adds volume to it | The buy or sell that starts a trade, or a scale-in |
| Out | Reduces or closes a position | The exit, a stop loss, a take profit, or one step of a partial close |
| In/out (reverse) | Closes the old direction and opens the opposite one in a single deal | A reversal on a netting account |
| Out by | Closes a position against an opposite one | A close-by on a hedging account |
Only exit deals carry a realised profit. An entry deal normally shows zero profit, although it can carry a commission, depending on how your broker charges costs. That is why a simple sum of the profit column still works, but a count of rows does not give you a count of trades.
Reading a normal trade
A simple trade has two deals: one entry and one exit. The entry shows the opening price and volume, the exit shows the closing price and the profit. If you filter the Deals list to a single symbol and sort by time, a clean trade appears as an in followed later by an out with the same volume. This is the easy case, and most beginners only ever meet this one.
Things get more interesting when the volumes do not match. If you buy 1.00 lot in two steps of 0.50 and then close in one exit of 1.00, you have two entry deals and one exit deal for one position. If you buy 1.00 and close 0.30, then 0.30, then 0.40, you have one entry and three exits. Both are still one position, and both are explained from the position side in scaling in and out and partial closes in history.
Reversals on netting accounts
On a netting account there is only one position per symbol. If you hold a long of 1.00 lot and send a sell of 1.50 lots, the platform closes the long and opens a short of 0.50 in one step. That single deal is the in/out type: part of it is an exit and part of it is an entry. The profit on it belongs to the closed part. The mechanics and a numeric walk-through are in position reversal on netting accounts. When you analyse a sheet, remember that one in/out row is really two events, and it can start a new trade and end an old one at the same timestamp.
Close-by on hedging accounts
On a hedging account you can hold a buy and a sell on the same symbol. The close-by function lets you close one against the other, which produces deals that the history marks as out by. The result of a pair closed this way is recorded across the two deals, and the costs can be split in a way that looks odd at first. See close by in trade history for how the rows look and why one side may show the profit while the other shows almost nothing.
How to group deals into trades in a sheet
- Copy the Deals rows into a sheet, as shown in sorting, filtering and copying rows, and keep the position ID column.
- Remove rows that have no symbol; those are deposits, withdrawals and similar operations, covered in non-trade rows.
- Group by position ID. Each group is one trade, and its profit is the sum of the profit, commission and swap values in the group.
- Take the open time from the earliest entry deal and the close time from the latest exit deal in the group.
- Count a trade only once, however many entry and exit deals it contains.
A worked example (hypothetical)
Suppose a position has three deals: an entry of 0.40 lots, a second entry of 0.20 lots, and one exit of 0.60 lots at a profit of 90 with a commission of minus 4 in total and a swap of minus 1. Counting rows gives three trades, which is wrong. Grouping by position gives one trade with a net result of 85. If you also want to know what happened inside the trade, the two entries show that you added after the first fill. The numbers are invented and only illustrate the grouping.
Where the labels can mislead
- A stop loss or take profit exit looks like any other exit; the reason is in the comment, not the entry type. See history comments for SL, TP and SO.
- An in/out row hides a closing result and a new opening in one line.
- Some brokers add rows for corrections or adjustments that are not trades; they have no entry in the usual sense.
- Strategy tester results use the same labels but are not live trades, as explained in strategy tester versus live history.
What the journal app does with this
AI Trading Journal, a Windows app for MetaTrader 5 only, reads the closed history on your own PC and keeps one entry per closed position, so the entry and exit deals do not have to be grouped by hand. Partial closes are combined, the entry is dated by the last exit on the broker’s server clock, and the result is profit plus commission plus swap. The app is read-only; it never places, modifies or closes a trade. It does not store a separate list of every in and out deal, so if you want to study how you scaled, write it in the notes of the entry.
Frequently asked questions
What does the in and out label mean in MT5 history?
Why do I see more deal rows than trades?
Which deals carry profit?
What is an in/out deal?
Do all brokers show the same labels?
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
Skip the grouping work with 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