Traders need historical data to test a trading strategy or advisor over a long period of time. 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 comments section, i recommend to watch this video. It’s not long, but covers 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 backtester, you need to have all the historical data handy.
For the purposes of this article, we’ll be loading data for 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:
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 long, so be patient.
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 an .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:
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 GMT time 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!