How to export your MT5 trade history to Excel
Get your closed trades out of MetaTrader 5 and into a spreadsheet in a few clicks, and clean the data so it is ready for a journal.
Export your closed trades from MT5
- In MetaTrader 5, open the Toolbox with Ctrl+T and click the History tab.
- Right-click inside the History list and choose the period you want, such as the last month, the last three months, all history, or a custom period.
- Right-click again and choose Positions to see one row per closed trade. The Deals view lists every entry and exit separately, which is harder to read.
- Right-click once more and open the Report menu, then save it as Open XML (MS Excel) or HTML. Menu wording can differ slightly between builds.
- Open the saved file in Excel or upload it to Google Sheets.
Make the history cover enough time
The History tab only shows the period you select. If your export looks short, set the period to all history first. If you cannot see older trades, your broker may keep only a limited history on the server.
Clean the data for a journal
- Keep one row per closed trade, with symbol, direction, volume, open and close time, entry and exit price, stop loss, take profit and profit.
- Use the profit figure as MT5 shows it, in your account currency, so commission and swap are included.
- Delete balance and deposit rows so they do not distort your statistics.
Then what?
You can paste the rows into the free MT5 trading journal template. If you find yourself exporting every week, that is the sign to automate it: AI Trading Journal reads your history from MT5 directly and keeps your journal up to date, so there is nothing to export. See Excel vs an automatic journal and four ways to track MT5 trades automatically.
Positions versus Deals: what you will see
Suppose you buy 1.0 lot of EURUSD, add 0.5 lots later, and close the whole position in two steps. In the Deals view MT5 lists every one of those transactions: two entries and two exits, four rows. In the Positions view you get one row for the trade, with the volume, the average open price and the final result. A journal that counts trades should start from Positions. If you start from Deals you will count one trade four times and your win rate and trade count will be wrong.
| View | Rows for the example above | Good for | Watch out for |
|---|---|---|---|
| Positions | 1 | Counting trades, win rate, profit factor | Partial closes are combined into one row |
| Deals | 4 | Seeing exact fills, commission per deal | Balance and deposit rows are mixed in; one trade spans several rows |
Fixing the usual export problems
- Dates look like text or swap day and month. Excel guesses the format from your regional settings. Select the time columns and use Data, Text to Columns (or Find and Replace on the dots in the date) to turn them into real dates before you sort or group by day.
- Numbers will not add up. MT5 can export numbers with a space as a thousands separator. If SUM returns 0, the cells are text; remove the spaces with Find and Replace and convert them to numbers.
- Symbols carry a suffix. Some brokers add endings such as .m or a trailing letter to every symbol. Add a helper column that keeps the first six characters so EURUSD.m and EURUSD group together.
- The times are in server time. MT5 shows the broker's server time, not your local time. If you group trades by session, subtract or add the offset first, and note which offset you used.
- Deposits and withdrawals appear as rows. They have a type of balance and no symbol. Filter them out before calculating anything.
- The file is empty or short. The History tab only exports the period currently shown. Set the period to all history, wait for it to load, then export.
Five formulas worth adding to the exported sheet
Assume the profit column is J and your trades run from row 2 to row 500. These work in Excel and Google Sheets:
| Number | Formula |
|---|---|
| Net profit | =SUM(J2:J500) |
| Win rate | =COUNTIF(J2:J500,">0")/COUNT(J2:J500) |
| Average win | =AVERAGEIF(J2:J500,">0") |
| Average loss | =AVERAGEIF(J2:J500,"<0") |
| Profit factor | =SUMIF(J2:J500,">0")/ABS(SUMIF(J2:J500,"<0")) |
The profit figure in an MT5 export normally excludes commission and swap if they are in separate columns, so add them if you want a net figure. Check against the totals MT5 prints at the bottom of the report before you trust the sheet.
How often to export, and what an export misses
If you export once a week, the job takes ten minutes and you can do it on Friday evening. Many traders find that after a few weeks the export becomes the part they skip, and the sheet then has gaps. An export only contains what MT5 knows: prices, times, volume, stop, target and result. It does not contain why you took the trade, what you felt, or a screenshot of the chart. Those fields only you can add, and the review is worth much less without them, so leave a column for notes next to every imported row. See what an MT5 trading journal should record for the full list.
Keep a copy of the raw file
Save each export under a dated name and keep it unchanged. When a formula looks wrong later you can always go back to what MT5 originally gave you. This also protects you against the broker's server holding only a limited history, because the file on your own drive is yours for good.
When the exported rows look doubled, the cause is usually deals versus positions: see MT5 deal, order and position IDs explained.
Exported totals too high? Balance rows for deposits and withdrawals are probably in the table.
Looking for candles instead of your trades? See how to export chart data from MT5.
On a Mac? See MT5 trading journal for Mac for how to export and where the options end. For chart data instead of trades, read price history vs account history.
Frequently asked questions
How do I export my MT5 trade history to Excel?
What is the difference between Positions and Deals in MT5?
Can I export MT5 history automatically?
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
Prefer not to export anything?
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