Export Deals History - script for MetaTrader 5




Export Deals History - script for MetaTrader 5


The script exports history of deals from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

It supports only retail hedging accounts (Forex).

To export the entire trading history, keep Start date and End date at their default values.


The CSV can be found in the folder MQL5Files

Following data columns are exported:

  • Open Time
  • Position ID
  • Symbol
  • Type
  • Volume
  • Open Price
  • S/L
  • T/P
  • Close Time
  • Close Price
  • Commission
  • Swap
  • Profit
  • Profit Points
  • Balance, this includes the running sum of all profits, swaps and commissions from previous trades
  • Magic Number
  • Duration, this includes duration of the trade expressed in (hh:mm:ss) format
  • Open Reason, this includes reason of opening the trade (client, mobile, web, expert)
  • Close Reason, this includes reason of closing the trade (client, mobile, web, expert, sl, tp, so, ...)
  • Open Comment
  • Close Comment
  • Deal In Ticket
  • Deal Out Ticket

Note that the history of deals (data rows) is ordered by Close Time to calculate the running Balance, correctly.



Download Export Deals History - script for MetaTrader 5




Related News




Latest News
Mexico reaches deal with U.S. to avoid tomato anti-dumping probe: minister
21.08.2019 10:15
MEXICO CITY (Reuters) - Mexican tomato producers have reached a deal with the U.S. Department of Commerce to avoid an anti-dumping investigation, Mexican Economy Minister Graciela Marquez said on Wednesday, ending tariff dispute that had rumbled on for months. Marquez said in a post on Twitter the accord had been reached shortly before midnight on
Read more
China Traders Bet Big on a Lagging Bank Stock in Hong Kong
21.08.2019 10:12
(Bloomberg) -- It’s trading near its lowest levels since 2016 and has lost $44 billion in value since an April peak -- but mainland investors can’t seem to get enough of China Construction Bank Corp. The Hong Kong-listed shares of the lender, one of China’s big four state-controlled banks, have seen mainland inflows of HK$6.2 billion ($790
Read more
Japan's Pension Fund Warns of Global Investing Losses
21.08.2019 10:09
(Bloomberg) -- Global markets have become so synchronized that money managers risk losing on every front, according to Hiromichi Mizuno, chief investment officer of the world’s largest pension fund. Japan’s $1.5 trillion Government Pension Investment Fund lost money in equities, fixed-income and currency positions in the last three months of 2018,
Read more
Trump Dismisses Recession Risk But Floats Ideas for Stimulus
21.08.2019 10:06
(Bloomberg) -- President Donald Trump has consistently rejected a growing number of forecasts that his trade war with China and slowing global growth are pitching the U.S. economy toward recession. But he’s also spending a lot of time outlining policies to stave it off. Speaking to reporters Tuesday in the Oval Office, Trump said he’s open to a
Read more
Ryanair strike kicks off in Portugal, minimum service guaranteed
21.08.2019 10:03
LISBON (Reuters) - A strike by Ryanair's (I:RYA) Portuguese cabin crew started on Wednesday, with the low cost airline warning passengers that a small number of flights may be affected and the government ordering workers to deliver a minimum service to avoid chaos. The five-day strike called by Portugal's SNPVAC union is the first of a
Read more