How to Download Historical Market Data from MetaTrader 5 as CSV

MetaTrader 5
Market data
CSV

MetaTrader 5 logo above a CSV table with a download arrow.

MetaTrader 5 lets you download one-minute bars and tick data from your broker and save them as CSV files. I’ll walk through an export using EURUSD, from choosing a date range in MT5 to opening the file in a spreadsheet. You can follow along with a demo account.

Connect MT5 to your broker

MT5 downloads historical prices from your broker’s server. If you’re already connected to an MT5 account, you can go straight to choosing between bars and ticks.

If you have an account but haven’t connected it yet, open File → Login to Trade Account. Enter your MT5 account number and password, select the server named in your broker’s account details, and click OK.

If you need a demo account, open File → Open an Account, search for your broker, and choose the demo option. I use IC Trading, which offers MT5 demo accounts.

Affiliate disclosure: I may earn a commission if you sign up through the IC Trading link.

Choose one-minute bars or ticks

If you want to chart EURUSD in a spreadsheet, choose Bars and set the timeframe to M1. Each row gives you the open, high, low, and close for one minute. You can see how far the price moved during that minute, though the bar alone won’t tell you whether it reached the high or the low first.

Choose Ticks if you want to follow individual price updates. For example, to see how the EURUSD spread changed within a minute, you can compare the bid and ask as each quote arrives. A single minute can contain many updates, so start with a short date range for your first tick export.

Check the bar limit before downloading

When I first downloaded historical bars from MT5, I ran into a setting called Max. bars in chart. It also limits how many bars MT5 will download. If you’re requesting several months of one-minute data, check this setting before you start.

Open Tools → Options → Charts and find Max. bars in chart. If you need more bars than the current limit allows, choose a higher value or enter one yourself. Click OK, then restart MT5 for the change to take effect.

MT5 Charts settings with the Max bars in chart dropdown near the bottom.

The Charts tab on MT5 desktop. This terminal’s bar limit is set to Unlimited.

Raising the limit lets MT5 request more bars. How far back you can go still depends on the history your broker has for that symbol.

Export one-minute EURUSD bars

  1. Right-click inside Market Watch, choose Symbols, and open the Bars tab.

  2. Select EURUSD and set the timeframe to M1. Choose your start and end dates. For a first export, try one recent trading day so you can inspect the file easily.

  3. Click Request. When the rows appear, compare the first and last timestamps with the period you requested. These are the bars you’re about to save.

    MT5 Bars tab showing the EURUSD M1 request, the returned price rows, and the Export Bars button.

    MT5 desktop returned 224,396 EURUSD minute bars for the example request.

  4. Click Export Bars, choose where to save the CSV, and include the symbol, timeframe, and date in the filename so you can identify it later.

Export EURUSD ticks

  1. In the same Symbols window, open the Ticks tab and select EURUSD. For a first export, choose one hour from the trading day you used for the bars. That gives you a smaller file and lets you compare both exports over the same hour.
  2. Click Request. Each row represents a tick. You may see several updates within the same second, with a change to the bid, the ask, or both.
  3. Click Export Ticks and save the CSV. Include the word ticks and the time range in the filename so it’s easy to tell the two exports apart.

Open and check your CSV

Open the bars file in your spreadsheet. If each row appears in a single cell, use the spreadsheet’s text import and choose Tab as the separator. The EURUSD file in this example has a .csv extension and uses tabs between its nine columns.

For this example, I requested one-minute EURUSD bars from CapitalPointTrading-Demo for 1 January through 8 August 2025. MT5 returned 224,396 bars. Here are the first two rows of the CSV.

<DATE><TIME><OPEN><HIGH><LOW><CLOSE><TICKVOL><VOL><SPREAD>
2025.01.0200:00:001.035151.035151.035151.035151070
2025.01.0200:01:001.035081.035151.035081.035154070

Read the second row across. The minute opened at 1.03508 and closed at its high of 1.03515. MT5 counted four ticks during that minute (<TICKVOL>). The separate traded-volume field (<VOL>) is zero in this sample. The spread is recorded in points.

Check the first and last timestamps against your request. This file starts on 2 January, one day after the requested start, and ends on 8 August at 00:00. Trading hours and the history available from your broker can both affect which minutes appear.

Keep the broker’s server name alongside your CSV. The filename tells you which symbol and dates you exported, but the server name tells you where the prices came from. That’s useful if you later want to download ticks for a particular minute and compare them with the bar from the same feed.