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

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

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.

ViewRows for the example aboveGood forWatch out for
Positions1Counting trades, win rate, profit factorPartial closes are combined into one row
Deals4Seeing exact fills, commission per dealBalance and deposit rows are mixed in; one trade spans several rows

Fixing the usual export problems

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:

NumberFormula
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?
Open the History tab in the Toolbox, choose the period, switch to Positions, then use the Report menu to save as Open XML (MS Excel).
What is the difference between Positions and Deals in MT5?
Positions shows one row per closed trade. Deals lists each individual entry and exit order separately.
Can I export MT5 history automatically?
Not with a built-in schedule. A tool that reads your MT5 history, such as an automatic journal, can do it for you on a timer.

Related guides

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