How to export your price data
A Quick or Pro Backtest runs on price history you supply, so the test sees the same prices your broker shows you. This guide takes about ten minutes. When the file is saved, check it for free.
What you need
- MetaTrader 5 on a computer, logged in to an account with the broker you trade the strategy with. A demo account of the same broker works.
- One file per symbol: one-minute (M1) bars for the whole period you want tested.
- At least 180 days of history for Quick Backtest and 365 days for Pro Backtest. Add a few months before the test period if your strategy uses long indicators, so they are warmed up when the test starts.
Export M1 bars even if your strategy trades H1 or D1. Higher timeframes are built from them, and the MetaTrader 5 test uses them to model price movement inside each bar.
Export from MetaTrader 5
1. Let the terminal keep all history
Open Tools → Options → Charts and set Max. bars in chart to Unlimited. Click OK and restart MetaTrader 5. With a lower limit, the export can stop short of the dates you ask for.
2. Open the symbol list
Open View → Symbols (or press Ctrl+U) and go to the Bars tab.
3. Request the bars
- In the first field, choose the symbol exactly as your broker names it, for example
EURUSDorEURUSD.r. - In the timeframe field, choose M1.
- Set the start and end dates of the period you want tested.
- Click Request. The terminal downloads the history from your broker. For several years of M1 bars this can take a minute or two.
Scroll to the top of the list and look at the first bar. If it is later than the start date you set, your broker has no older M1 history for this symbol. That is the earliest date you can test.
4. Export
Click Export Bars and save the file. Keep the name MetaTrader 5 suggests, for example EURUSD_M1_202001020000_202412312359.csv: it contains the symbol and timeframe, and the check reads them from it.
A year of M1 bars is roughly 20 to 40 MB. Several years can be over 100 MB; that is normal.
5. Check the file
Open Check your price data, choose the file and click Check the file. The check runs in your browser and shows what, if anything, to fix.
Mistakes that make a file unusable
- Opening and saving it in Excel or another spreadsheet. It rewrites dates and decimal separators. If you want to look at the file, close it without saving, or export again.
- Joining several exports into one file. Overlapping ranges create duplicate bars. Export the whole period in one request instead.
- Exporting H1 or another timeframe. The test needs M1 bars.
- Converting the time zone. Keep the broker’s server time as exported. Most MetaTrader 5 brokers use UTC+2 in winter and UTC+3 in summer, so a week usually starts on Monday at 00:00 in the file. That is expected.
- Mixing symbols or brokers. One file is one symbol from one broker.
From another source
If your data does not come from MetaTrader 5, for a Python strategy for example, save it as a text file in this layout. A header row is recommended.
| Column | Required | Format |
|---|---|---|
<DATE> | Yes | 2024.01.02, 2024-01-02 or 2024/01/02 |
<TIME> | Yes | 00:00 or 00:00:00, the opening time of the bar |
<OPEN> <HIGH> <LOW> <CLOSE> | Yes | Decimal point, no thousands separator: 1.08345 |
<TICKVOL> <VOL> | No | Whole numbers |
<SPREAD> | No | Whole number of points. Without it, the test uses the costs you set in the order. |
- Columns separated by a tab, a comma or a semicolon; the same separator on every line.
- One bar per line, oldest first, one minute apart. Minutes with no trading may be missing; that is normal.
- Date and time may also be one column,
2024-01-02 00:00. Name it<DATETIME>. - One time zone for the whole file, without daylight-saving jumps you added yourself.
- UTF-8 or UTF-16 text, as MetaTrader 5 saves it.
Your data stays yours
The free check never uploads the file. When you order a test, we use the file only for your test and delete it 30 days after the order. Use only data you are allowed to use for this purpose under your broker’s or data provider’s terms; see the terms.