Export historical data – script MetaTrader 5

Export historical data - script for MetaTrader 5
The script purpose is to export historical rates data to format, convenient for analysis in external programs, for example, in MathCad (example is attached). The output file contain the historical price data (bars) of the specified month in the following form:  DoubleToString(rates[i].time,0),     // number of seconds, passed from 1 Janunary 1970               rates[i].open,         // Open … Read more

Export Indicator’s Values – script MetaTrader 5

Export Indicator
After searching for such script, I decided to create mine, and decided to share it with the MQL5 community. This script exports indicator’s values to CSV File along with date and time (you can change the iCustom function parameters to change what indicator to export). Version 2: Enhanced code; Values are now exported as numbers … Read more

sHistoryExport – handy script to export the historical data in the МetaТrader 4 format – script MetaTrader 5

sHistoryExport - handy script to export the historical data in the МetaТrader 4 format - script for MetaTrader 5
Script for historical data export. Problems with history in MetaTrader 4? Load the detailed history of any depth from MetaTrader 5!   Step 1: Set up Load script in the “terminal_data_folder\MQL5\scripts\”. Load libraries CheckHistory and String to the “terminal_data_folder\MQL5\Include\komposter\”. Compile the script.    Step 2: Set the depth of the history Go to the menu “Tools – Options” … Read more

Trade History Export to CSV – indicator MetaTrader 4

EURUSDProHistory
Exports CSV file to analyze trade history for a symbol. Input parameters: InputFileName — export file name InputDirectoryName — export directory name InputHistoryStartDateTime — analysis start date InputHistoryEndDateTime — analysis end date Analysis trade type: OpBuy — Buy OpBuyLimit — Buy Limit OpBuyStop — Buy Stop OpSell — Sell OpSellLimit — Sell Limit OpSellStop — … Read more

Export Positions History V1 – script MetaTrader 5

Export Positions History V1 - 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. For version 2 of the script, please go to  It supports only retail hedging accounts (Forex). To export the entire trading history, keep Start date and End date … Read more

Export Deals History V1 – script MetaTrader 5

Export Deals History V1 - script for MetaTrader 5
The script exports history of deals (ordered by close time) from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. For version 2 of the script, please go to https://www.mql5.com/en/code/25200 It supports only retail hedging accounts (Forex). To export the entire trading history, keep Start date and End date at their default … Read more

Export trade history to CSV v2 – script MetaTrader 5

Export trade history to CSV v2 - script for MetaTrader 5
This is the version 2 of my script to export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. The CSV can be found in the folder MQL5Files Following data columns are exported: Position ID Type Symbol Volume Open Date/Time Open Price … Read more