Export MT4 Trade History to Excel: The Steps and What the Report Holds
MetaTrader 4 saves history as an HTML report. The clicks, the columns it lists, whether it keeps the stop, and what MetaQuotes' help leaves unsaid.
3 Nov 2026 · 5 min read
On this page
MetaTrader 4 saves its account history as an HTML report. You get to a spreadsheet by opening that saved file. Below: the clicks, what each row holds, which stop and take-profit columns it carries, and what to check in the file.
The steps
- In the terminal, open the Account History tab.
- Right-click inside it and choose the period: All History, Last 3 Months, Last Month or Custom Period.
- Right-click again and choose Save as Report or Save as Detailed Report. Both write an HTML file; a window asks where to save it.
- Open the file in a browser to check it, then in a spreadsheet (see below).
The same right-click menu has switches to show or hide the Commissions, Taxes and Comments columns. Look at the saved file to see whether a column you hide is left out before you rely on it.
What a row holds
MetaQuotes lists the Account History columns from left to right: Order (the ticket number), Time (open), Type, Size, Symbol, Price (open), S/L, T/P, Time (close), Price (close), Commission, Taxes, Swap, Profit and Comments. The saved report splits trades into Closed Transactions, Open Trades and Working Orders, and adds a Summary (deposits and withdrawals, closed and floating profit and loss, balance, equity, margin, free margin) and a balance chart with statistics such as total net profit, profit factor and drawdown.
MT4 accounts are hedging, so each order is its own position and its own ticket; the guide to netting and hedging accounts explains why that matters when you count trades.
Does it keep the stop?
The columns include S/L and T/P, so a history row does have a stop-loss and take-profit field. Check whether the figure is the stop the trade opened with or the last one it had when it closed. That decides whether you can rebuild the risk of a trade you later moved the stop on. Test it: pick one closed trade where you moved the stop, save a report, and read what the S/L column holds.
The Detailed Report
MetaQuotes says a detailed report "differs from a normal one for an additional set of parameters" and that the number of fields shown depends on the report type. If you need to know which fields the detailed one adds, save one of each and compare.
From the HTML file to a spreadsheet
A spreadsheet can usually open an HTML file that contains tables, or you can copy the trade table from the browser and paste it in. Then:
- Keep only the trade table. The summary and statistics sit above and below it.
- Check that the times came across as dates and the prices and profit as numbers, not text.
- Check the decimal separator. A number written with a comma or a different separator can arrive as text.
- Remove the Working Orders and Open Trades rows if you want closed trades only.
Once the table is clean, save it as an ordinary spreadsheet, or as a comma-separated (.csv) file for another tool.
Adding the risk
If the S/L column holds the stop you opened with, a trade's R follows from prices alone, with no pip value. For a long trade it is (close price − open price) / (open price − S/L), and for a short trade (open price − close price) / (S/L − open price). The backtest log template does this in a spreadsheet, and the trading journal template takes risk and result in money. Where the stop was never set, or was moved, risk is yours to type in.
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. MT4's unit of a trade against MT5's is on the MT4 and MT5 journal fields page. The same questions for MT5 and cTrader have different answers.
Written by the Trepeat team.