Summary: This tutorial covers multiple methods to export MT4 trading history, including the built-in account statement, HTML reports with equity curves, and custom CSV exports for detailed performance analysis in Excel.




One thing I've noticed over the years is that most traders don't realize how much data is sitting right there in their MT4 terminal. The "Account History" tab isn't just for glancing at past trades—it's a goldmine if you know how to pull the data out properly.

The Built-in Method: Account Statement with Equity Curve

The quickest way to get a comprehensive view is the built-in account statement. Here's what you do:

  • Open MT4 and hit <strong>Ctrl+T</strong> to bring up the Terminal window [citation:4][citation:1].

  • Click on the "Account History" tab at the bottom.

  • <strong>Right-click</strong> anywhere inside the history area.

  • Select either "Save as Report" or "Save as Detailed Report".


  • This generates an HTML file that contains everything—trade-by-trade breakdown, summary statistics, and most importantly, a visual equity curve showing your account balance progression over time [citation:4][citation:1].

    The detailed report gives you more granular information: profit factor, expected payoff, absolute drawdown, maximum consecutive wins and losses, and the full trade list with timestamps, prices, and P&L [citation:4].

    One thing to watch: if you want to view all your history, right-click and select "All History" before saving. Otherwise, you'll only get whatever date range filter is currently applied [citation:3]. I've made that mistake more than once—exported three months of data when I thought I was getting everything.

    The CSV Export Method for Custom Analysis

    The HTML report is great for a quick snapshot, but if you want to analyze your trades in Excel pivot tables or import them into Python for deeper analysis, you need CSV.

    There are a few ways to get CSV exports. The MQL5 Market has dedicated scripts like ExportCSV that let you export account history within a specified period directly to CSV format [citation:5][citation:7]. These scripts output fields like Ticket, Type, Symbol, OpenTime, CloseTime, Lots, OpenPrice, ClosePrice, SL, TP, Profit, Commission, Swap, NetProfit, Pips, Magic, and Comment—everything you'd need for serious analysis [citation:5].

    Some scripts even generate calculated fields like HeatMap data that splits trades by day of week and 15-minute time slots, making it easy to spot patterns in your trading behavior [citation:10].

    The Hidden Challenge

    Here's something the official documentation won't tell you: if your account history is filtered to "Last 3 Months" when you export, that's all you'll get—even if you click "All History" afterward, the export takes whatever is currently displayed [citation:10]. I spent an hour wondering why my CSV only had 50 trades when I knew I'd made over 300. The fix? Remove all date filters before saving.

    A Quick Tip on Equity Curve Generation

    Some traders think they need to manually export data into Excel to build an equity curve, but MT4 actually generates this automatically in the detailed report HTML [citation:4]. Open the saved HTML file in your browser and scroll down—you'll see a visual representation of your equity growth right there, no manual charting required.

    Reference: MQL5 Market - ExportCSV Utility (mql5.com); MetaQuotes Help Center.

    This article was originally published on FXEAR.com. All rights reserved. Unauthorized reproduction is prohibited.