Account History Export
- Utilities
- Yuriy Bykov
- Version: 1.24
- Updated: 23 January 2023
Performs export of the transaction history of the current trading account.
The file is saved in the MQL4/Files terminal folder ( which can be opened via the main terminal menu: File -> Open Data Directory (Ctrl+Shift+D) and go to folder MQL5/Files) or in the terminal's Common/Files folder.
The file name is generated automatically or set manually through the script parameters.
The history file can be used to simulate the same sequence of trades on another trading server using an EA Simple History Receiver.
- Name for file : Specify a file name or leave the field blank to automatically generate a file name.
- Separators : set separators for data parts in CSV file (comma ',' or semicolon ';') and decimal point (period '.' or comma ',')
- Save file to Common Folder : If True, the file will be saved to the Common/Files folder.
- Copy file to FTP-Server : copy a file to the FTP server specified in the terminal settings
- Folder on FTP to export : Folder on the FTP server to export. Can be set in the terminal settings or in this parameter
- Export history every N minutes. 0 - don't use : export periodically after the number of minutes specified in this parameter. If it is 0, then the EA will export once and will be removed from the chart. If greater than 0, then the EA will export data with the specified period until it is manually removed from the chart.
File format
The heading is placed first (the separator is set in the parameters)
DATE,TICKET,TYPE,SYMBOL,VOLUME,ENTRY,PRICE,STOPLOSS,TAKEPROFIT,PROFIT,COMMISSION,FEE,SWAP,MAGIC,COMMENT
After it and until the end of the file there are lines with comma-separated field values for one deal.
Field values per line:
- DATE - date in YYYY.MM.DD HH:MM:SS format
- TICKET - deal ticket (integer)
- TYPE - deal type from ENUM_DEAL_TYPE (integer)
- SYMBOL - trading instrument (string)
- VOLUME - deal volume (real number)
- ENTRY - deal type from ENUM_DEAL_ENTRY (integer)
- PRICE - transaction price (real number)
- STOPLOSS - Stop Loss level (real number)
- TAKEPROFIT - Take Profit level (real number)
- PROFIT - trade profit, for opening it is equal to 0 (real number)
- COMMISSION - commission amount (real number)
- FEE- fee amount (real number)
- SWAP- swap size (real number)
- MAGIC - number of the expert who made the deal
- COMMENT - comment
Excellent work, seven stars, all I wanted, thank you. Juri is very responsive and friendly.