MT4 history data import – some notes

so I’m trying to run some EAs, some backtesting, and I need historical data. After some googling and messing around, I finally can import csv-formatted data into MT4.

I got my data from http://www.forexdirectory.net/forexhistoricaldata.html, which is awesome since it allows you to select timeframe. I chose EURUSD.M1 and asking for 2011-2013 data. It takes a good while(almost an hour and counting!) to generate that CSV file. It even lets you select volume units in 1,1k and 1M. Yep, no lot/mini/micro lot…so need to do some manual changing.

After it generates the CSV, download it and put it somewhere.

Usually, this will contain millions of lines, so Excel is not much good here. I use notepad++ to open it and will try to perform some manipulation so it can be recognized by MT4.

I see a lot of issues with date/time online, and I did my fair amount of trail&error, and I think I got how it works. Basically you need to change the date/time to the following format:

“yyyy-mm-dd hhmmss”

so for jan 1st, 2011, midnight it will look like this:

2011-01-01 000000

and then it’s regular OHLC and volume. Depending on your broker’s live feed, you may want to do some manipulation on the volume number. I suspect that Oanda sends volume data in lots, so I may have to divide the number in CSV(I got it in units) by 1e5 to get the lot number.

Posted in Forex Tagged with: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*