Export trades from MetaTrader 4

MT4 gives you one export worth having, and it arrives as an HTML page rather than a spreadsheet. Inside it, several rows are not trades at all.

Getting the file

In the terminal, the Account History tab holds closed trades. Right-click inside it and you get two useful things:

  • Save as Report — a plain HTML statement.
  • Save as Detailed Report — the same plus a summary block and charts.

Either parses. Before saving, right-click again and choose the period: the default view often shows only the last few days, and the export saves what is displayed, not everything the account has. This is the most common reason an export comes back nearly empty.

MT4 has no CSV export for history. The file is an .htm page, and that is normal — the tables inside are structured well enough to read reliably.

Not every row is a trade

The statement's table mixes several kinds of row:

  • buy / sell — actual trades
  • balance — deposits and withdrawals
  • credit — bonuses and credit adjustments
  • header and subtotal rows

A deposit row has a value in the profit column, which is exactly why naive imports get it wrong: a $5,000 deposit read as a trade produces one enormous "winning trade" that flatters every statistic you own. Rows are distinguished by their type field, not by whether a number is present.

The 14 columns

Ticket · Open Time · Type · Size · Item · Price · S/L · T/P
· Close Time · Price · Commission · Taxes · Swap · Profit

Worth noting:

Two columns are called Price. Position six is the entry, position ten is the exit. In the HTML they are only distinguishable by order, which is why anything reading this file works by column position rather than by name.

S/L and T/P are in there — positions seven and eight. MT4 keeps the plan you set, and like MT5 it stores the final stop rather than the original, so a widened stop is invisible.

Costs are split three ways — commission, taxes and swap. Taxes is usually zero outside a few jurisdictions, but it exists and belongs in the total.

Profit is gross, like MT5. The three cost columns are not deducted from it.

Open positions are in a separate block

Below the closed trades, the statement lists open positions and pending orders. They have no close time and no realised result, so they are not part of your performance history — a journal should ignore them until they close, and an average that counts them as zero is quietly wrong.

The encoding detail

MT4 statements are often written with non-breaking spaces inside numbers as thousands separators — 1 234.56 where the gap is not an ordinary space. Copy such a value into a spreadsheet and it becomes text rather than a number.

If you are opening the file in Excel to check something, that is why a column refuses to sum. It is a property of the export, not a corrupted file.

Checking the file

Any of the analyzers reads an MT4 statement directly: intent vs execution uses the S/L column, the discipline check uses the rest. Both run in your browser, so it is a fast way to see whether the export actually covers the period you expected before importing it anywhere.

More in How to export your trades

  • Export trades from MetaTrader 5MT5 offers three reports and only one reconstructs your trades correctly. Which to pick, which columns it carries, and why the deals report doubles your trade count.
  • Export trades from cTraderHow to export cTrader trade history, and why its P&L column can already include commission — which makes double-counting costs the easiest mistake to make.