Export Positions History - script for MetaTrader 5




Export Positions History - script for MetaTrader 5


The script exports history of closed positions 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
  • Magic Number
  • Comment, this includes comments of all in/out deals for position
  • Deal In ID, this includes id of the deal in for position
  • Deal Out ID, this includes ids of all the deals out for position

The closed positions are reconstructed in the same representation as in the History tab of the MetaTrader 5 terminal.



Download Export Positions History - script for MetaTrader 5




Related News




Latest News
Factbox: Timeline of the Russia doping case
07.12.2019 14:06
LAUSANNE, Switzerland (Reuters) - The World Anti-Doping Agency (WADA) will on Monday consider a recommendation from its compliance committee to hand Russia a four-year Olympic ban as part of a sanctions package to punish Moscow for handing WADA doctored and incomplete laboratory data. Russia, which has denied state involvement in doping, says the
Read more
Germany's SPD slip in polls after choosing new leftist leaders
07.12.2019 14:03
BERLIN (Reuters) - Support for Germany's Social Democrats (SPD) has fallen after members last week chose as leaders a leftist duo who are skeptical about remaining in government with Chancellor Angela Merkel's conservatives, a poll showed on Saturday. At a party conference on Friday, the SPD gave their new leaders, Saskia Esken and
Read more
United States and Iran swap prisoners in rare act of cooperation
07.12.2019 13:06
By Parisa Hafezi DUBAI (Reuters) - The United States and Iran swapped prisoners - a Chinese-American detained for three years on spying charges and an imprisoned Iranian - on Saturday in a rare act of cooperation between two longtime foes whose ties have worsened since President Donald Trump took office. Trump said Chinese-American Xiyue Wang was
Read more
Pope meets with Maltese PM hit by scandal over reporter's murder
07.12.2019 13:03
VATICAN CITY (Reuters) - Pope Francis on Saturday gave a private audience to outgoing Maltese Prime Minister Joseph Muscat, ignoring an appeal to cancel the meeting with a premier engulfed in crisis over a probe into a murdered journalist. Francis met Muscat and his wife and family on Saturday morning, the Vatican said, in an audience that was far
Read more
Buttigieg pledges billions to curb education disparities
07.12.2019 12:15
By Michael Martina DETROIT (Reuters) - Democratic presidential candidate Pete Buttigieg vowed on Saturday to spend hundreds of billions of dollars to improve public education if elected, with a plan that boosts funds for "underserved children" and expands early childhood learning. Buttigieg, who has campaign stops this weekend in Iowa where he has
Read more