How to Import Historical Data in MT4

Traders need historical data to test a trading strategy or advisor over a long period. In this article, I’ll break down how to load historical data in MT4, a popular trading platform.

Before reading the article and writing your questions in the comments section, I recommend to watch this video. It’s not long but covers the biggest part of questions on the topic.

 

A freshly installed MT4 has a limited set of historical data. As you scroll to see earlier data, it’s uploaded directly from your broker’s server. As a result, the platform may freeze from time to time.

If you’re testing your strategy manually, this might not be a problem. If, however, you’re using a backtest, you need to have all the historical data handy.

For this article, we’ll be loading data for the M1 timeframe. Other timeframes can be easily recalculated from M1.

Open MT4 and press “Ctrl+O”. In a new window, click on the “Charts” tab and set the maximum value in the “Max. bars in history.” See the screenshot below:

how to download mt4 history

In the main menu, select “Tools” — “History Center.” (Alternatively, you can press F2.)

In the “Symbols” section, double click on the currency pair you’re trading (in our case, this is GBPUSD) and then double click on “1 minute.” Click on “Import” at the bottom of the window. The data will start to load. It may take longer, so be patient.

mt4 history data download

Once loading is complete, you’ll see a message offering to recalculate the data for other timeframes. Press “OK.” Then restart the trading platform.

How to import historical data from other brokers?

You should keep in mind that the quality of historical data varies across brokers. It’s not uncommon that the quotes may have big gaps. What do you do if you’re not happy with the historical data offered by your broker?

Don’t worry. You can easily get the data for your selected currency pair and timeframe from other brokers or websites.

Historical data are usually available in .csv or .hst files. Upon downloading a .hst file, put it in the “History” folder (c:\Program Files\MetaTrader\ history). Be sure to delete the previous .hst file for the currency pair in question.

 

If you downloaded a .csv archive, open “History Center”:

Click on “Import” at the bottom of the window. A new window will pop up:

uploading history data in mt4

Click on the “Browse” button in the upper right corner. Find the corresponding file (“GBPUSD 1M”) on your computer and double click on it. If your broker’s time zone is different from the time zone of your downloaded data, you need to set a “Shift” value. For example, if your downloaded archive has a GMT zone and your broker operates in GMT+2, you need to select “+2” in the “Shift” field. Click “OK.”

As you can see, loading historical data is a piece of cake. Once you try it once, you’ll be able to do it with your eyes closed! Good luck trading!

 

2 COMMENTS

  1. I’m trying to import .csv historical data downloaded from Dukascopy. When clicking on “import” button, it only lets me select one .csv file at a time. Is there an optimal way to do this in bulk?

  2. In the main menu, select “Tools” — “History Center.” (Alternatively, you can press F2.)

    In the “Symbols” section, double click on the currency pair you’re trading (in our case, this is GBPUSD) and then double click on “1 minute.” Click on “Import” at the bottom of the window. The data will start to load. It may take longer, so be patient.

    I think this is incorrect and confusing. You have to click ‘Download’.

LEAVE A REPLY