Data Import
Data Import uploads historical market data exported from your own MetaTrader 5 terminal and manages the files you uploaded. Broker history, spread behaviour and trading sessions differ between brokers, so testing on your broker's own bars keeps a backtest closer to what the same strategy would do live.
The page has three parts: a toolbar button that downloads the MetaTrader 5 export script, a drop zone for the exported files, and the Imported Data list of everything you have uploaded.
| Area | What it is for |
|---|---|
| Toolbar | Bar_Data_Export.mq5 — downloads the export script (the button shows its version once it is known) |
| Drop zone | Drag files in, or click it to choose them in the file picker |
| Imported Data | One row per imported market, with the sizes, the dates, and a remove button |
Before you start
- Sign in. Uploading, downloading the script, removing data and reading the list all need an account. Signed out, the page shows
Please log in to be able to upload or manage custom data.above the drop zone andPlease log in to see your custom data.in the table. - Your imports are yours. The files and the list belong to the account that uploaded them; signing in as another user shows that user's own list.
- The file name matters, its text does not. A file is accepted when its name ends in
.bar.bin(bars) or.tick.bin(ticks). Anything else answersIt is not a supported file type.The server, symbol and period are read from inside the file, so a renamed file still imports as the market it holds. - The data is the file's own. Nothing is downloaded or guessed while you import: the bars, their spreads and the symbol's parameters all come from your broker's terminal.
Upload limits
The drop zone states both limits:
| Account | Bars per file |
|---|---|
| Trial | 200,000 |
| Licensed | 3,000,000 |
A larger file is still accepted: it is trimmed to the limit before it is sent, the oldest bars are dropped and the newest ones are kept, and the success message reports the original count, ending for example with (trimmed from 1,204,318 bars to the 200,000-bar limit).
The export script has its own cap — see below — so an export usually stops before the upload limit does.
Download the export script
Click Bar_Data_Export.mq5 in the toolbar to download the MetaTrader 5 script; once the app has read the published version, the button reads Bar_Data_Export.mq5 v1.01. The download needs login.
Export data from MetaTrader 5
To export as much history as your broker provides:
- In MetaTrader 5, open File → Open Data Folder.
- Copy the downloaded
Bar_Data_Export.mq5into MQL5 → Scripts. - Back in MetaTrader 5, open the Navigator (View → Navigator if it is hidden), right-click inside it and choose Refresh.
- If the script does not compile by itself, right-click it in the Navigator, choose Modify, click Compile in MetaEditor, then close MetaEditor.
- Open a chart for the symbol whose history you want.
- Disable chart auto-scroll.
- Zoom out (
Ctrl + -) so MetaTrader 5 loads more bars per screen. - Hold the
Homekey until older bars stop loading. Alternatively raise Tools → Options → Charts → Max bars in chart (the script's own hint suggests 10,000,000) and reopen the chart. - Drag
Bar_Data_Export.mq5from the Navigator onto the chart, review the inputs and run it.
What one run writes
The script exports the chart's symbol at every period it can — M1, M5, M15, M30, H1, H4 and D1 — so one run usually leaves seven files in MQL5 → Files of the terminal's data folder, named <SYMBOL>_<PERIOD>.bar.bin (for example EURUSD_H1.bar.bin). Import as many of them as you need; a market with one period is perfectly usable.
Its inputs are worth a look before the first run:
| Input | Meaning |
|---|---|
| Maximum bars | The most bars one file may hold, 100,000 by default. Raise it (to the limit of your account) if you want more history |
| Commission | Commission per lot for an open plus a close, written into the file's symbol information |
| Data export start | The oldest date to export; bars before it are left out |
The script also writes the symbol's trading parameters — digits, contract size, lot step, swap, stop level — into the file, so the imported market carries your broker's settings rather than the app's defaults. If the terminal prints Error: Symbol not available, the symbol is not in the Market Watch: add it there and run the script again.
Import files
- Drag the exported
.bar.binfiles onto the drop zone, or click the drop zone and select them. - Each file is checked, parsed and compressed (
gzip) in the browser before it is sent, and the upload is authenticated. - The success message names the market and the bar count:
MetaQuotes-Demo EURUSD H1, bars: 145,982. - After a successful import the cached copy of that market is dropped, so the next backtest, chart or statistics page reads the new file.
Several files can be dropped at once. They are imported one after another, and a file that fails reports its own message without stopping the rest:
| Message | Meaning |
|---|---|
It is not a supported file type. | The name does not end in .bar.bin or .tick.bin |
Cannot load file content | The file is unreadable, or it is empty |
Cannot import "<name>" at the moment | The same file is already being processed |
Error in "<name>": … | The file is not a valid export: it was truncated, or it came from another tool |
Failed to Import Data: <market>: … | The server refused the upload; the message carries its reason |
Importing the same market and period again replaces the previous file: it is not a second entry, and the Imported date moves to the new upload.
Bar files and tick files
A .bar.bin file is stored as the bars it holds. A .tick.bin file is stored as ticks in that market's M1 slot, and every period you ask for later is built from those ticks — so one tick file can serve M1 as well as H1. In the list a tick file shows as the market's M1 row when grouping is off.
Imported Data
| Column | What it reports |
|---|---|
| Market | Server and symbol, plus the period while grouping is off |
| Imported | When the file was last uploaded |
| Last Used | When the app last loaded that market — - until it happens |
| Bars | How many bars the entry holds; a tick import reports the M1 bars it was built into (hidden while grouping is on) |
| Size | The size of the imported file, uncompressed |
| Remove | The trash button that removes the entry |
The two date columns are compact on purpose: a time (14:22) for today, a month and day (Jul 20) for this year, and a full date (2025 Jul 20) for older entries.
Under the rows is a totals line: the number of entries and their total size.
Click a column header to sort by it, and click the active header again to reverse the direction. A column you sort by for the first time starts descending — newest import first, largest file first — so the top of the list is the most recent or the heaviest data. The list starts sorted by Market, descending.
Group by server and symbol
Group by server and symbol is on by default, and it decides what one row means:
| Grouped (default) | Ungrouped | |
|---|---|---|
| One row per | Server and symbol | Server, symbol and period |
| Bars column | Hidden | Shown |
| Imported | The newest import among the market's files | That file's own import |
| Last Used | The most recent use of any of its periods | That file's own last use |
| Size | The sum of the market's files | That file's own size |
| Remove | Every period of that market | That one period |
Grouping is the overview: it answers "which markets do I have" in a few rows. Ungrouped is the inventory: it shows which periods of a market are imported and how big each one is.
Sorting by Bars is not possible while grouped, because the column is hidden; grouping then falls back to sorting by Market.
Remove imported data
The trash button asks for confirmation before anything is deleted, naming the consequence and the size, for example Every imported period of MetaQuotes-Demo GBPUSD (18.91 MB) will be removed. This cannot be undone. Apply removes it, Cancel (or Esc) keeps it.
- There is no undo: the file is gone and has to be exported from MetaTrader 5 again. Check the market name in the dialog before you apply.
- Grouped, the whole market goes; ungrouped, only that period.
- The confirmation is the only warning. Removing the data a strategy was tested on does not change the stored strategy or its results, it only means the next recalculation has no bars for that market.
- Removing the last file of a server removes that server from the market selectors of every page, because the custom source exists only while it holds data.
Common problems
| Symptom | Cause |
|---|---|
It is not a supported file type. | The file name must end in .bar.bin or .tick.bin; a .bin file renamed to something else is refused |
Error in "<name>": … on every file | The export was interrupted, or the files came from another tool. Run the script again and wait until it reports the bar counts |
| The script exported fewer bars than expected | Its Maximum bars input (100,000 by default), the chart's own history, or Max bars in chart in the terminal options. Raise them and run it again |
| The bars stop at the account limit | A Trial account keeps 200,000 bars per file and a licensed one 3,000,000; older bars are trimmed |
| A market is listed but a backtest still shows old bars | The app drops the cached copy on import, so reopen the page or the test; if the market is still wrong, check which server and period the test uses |
Last Used stays - | Nothing has loaded that market since it was imported |
| A market disappeared from the Source selector | Its last file was removed; export and import it again |
Where to go next
- Data Statistics — check the imported series before testing on it: completeness, spread, gaps and the quality score.
- Data Horizon — cap how many of the imported bars a backtest loads.
- Symbol Settings — override digits, swap, commission or minimum spread for the imported market without touching the file.