Export MT5 Deals and Positions to Excel: Which Rows You Get, and Why
In MT5 a trade can be an order, a deal or a position. Which one you export, and whether the account is netting, decides what a row means.
3 Nov 2026 · 6 min read
On this page
MetaTrader 5 describes the same trading three ways, as orders, deals and positions, and which one you export decides what "a trade" means in your spreadsheet. MetaQuotes' help names an HTML report. Its release notes name Open XML (2010) and PDF (2024).
The steps
- In the terminal's Toolbox window, open the History tab.
- Pick the view (orders, deals or positions), the instrument and the time period.
- Right-click in the tab and choose Report. MetaQuotes says the report is generated from a template named ReportHistory.htm.
- Open the saved file in a browser, then in a spreadsheet.
The saved report has these blocks: Header (broker, account number, owner, currency, date), Orders, Deals, Positions, Working Orders, Summary and Details. Details holds a balance chart and statistics such as gross profit, gross loss, total net profit, profit factor, expected payoff and three drawdown measures.
Orders, deals and positions are not the same row
| View | One row is | Reach for it when |
|---|---|---|
| Orders | One request sent to the broker, including ones that were cancelled. | Seeing what you asked for and what became of it. |
| Deals | One actual buy or sell that executed, based on an order. | The raw fills: price, size, commission and fee for each one. |
| Positions | One position, built from its deals: opening, adding, partial closes and the full close. | One line per trade, with weighted average open and close prices and the total result. |
The History tab's Positions view groups the deals of one position, while the saved report's Positions block lists open positions, with floating profit and loss at the foot, and its Deals block lists every trade executed on the account, with closed profit and loss at the foot. If you want closed trades, check which block of your report holds them before you build on it.
Netting and hedging change what a row means
On a netting account MetaQuotes says one financial instrument can have only one position at a time, and an opposite trade reduces or closes it. On a hedging account several positions in the same symbol can be open together. Take a made-up sequence in one symbol: buy 0.10 lots, buy 0.05, then close everything. On a netting account that is one position of 0.15, closed by one opposite deal: three deals, one position. On a hedging account the two buys are two positions, each closed on its own: four deals, two positions. The number of rows depends on the view you export and on the account mode. The guide to netting and hedging accounts covers the modes themselves.
The History tab also has a Direction column that reads in, out or in/out against the symbol's position, which is how a deal that opens, closes or reverses a position tells itself apart.
Does it keep the stop?
Yes, in part. MetaQuotes lists S/L and T/P among the columns of the list of trades. It says the stop-loss of an entry or reversal deal is set from the stop-loss of its order, and that exit deals use the position's stop-loss at the moment it closed. Read together: the entry deal is where the stop you opened with sits, and a stop you moved later shows only on the exit deal. For risk, take S/L from the entry row, and confirm on one real report that the entry row carries the stop.
What format do you get? It varies by build
- Build 291, 2 July 2010: "Revised trade history reports in formats HTML and OpenXML."
- Build 4150, 18 January 2024: "Added export of trading reports to HTML and PDF files," with export commands in the File menu and the report menu.
- The current help names only the HTML report.
Which formats you get depends on your build, so look at your own right-click menu. If it offers Open XML, Excel opens it directly. If it offers only HTML, use the browser-and-paste route from the MT4 guide, then save as a spreadsheet or a .csv file yourself.
Where to go next
Once the trades are in a sheet, the trading journal template takes risk and result in money, and the backtest log template works R out from prices.
We're working on a free journal and a backtester, with no date yet. Today Trepeat is a trade copier for MT4, MT5 and cTrader, currently on demo accounts, and you can add notes, a grade and screenshots to any copied trade once it closes, with a calendar of your results.
That journal does not import a history file today; the journal documentation says what it holds. What this means for a journal's trade count is on the MT4 and MT5 journal fields page.
Written by the Trepeat team.