MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (2024)

Backtesting MetaTrader expert advisors onhistorical data is agood way totest astrategy. But testing onthedefault data available inyour MT4 installation gives avery poor quality oftesting (usually below 50%). So, how toachieve a90% quality inbacktesting ofMT4 expert advisors? It isn't that hard really. Just follow this simple tutorial andyou will able totest any MetaTrader EA with atleast 90% modeling quality.

This tutorial has been compiled toprovide accurate information regarding 90% vs 99.9% modeling quality andtopresent aneasy method ofgetting quality historical data inyour MT4 platform.

It is recommended touse aseparate installation ofMT4 toset up quality backtesting data there andtoavoid it being overwritten withpotentially flawed broker's data.

1. Download anew MetaTrader 4 installation andinstall it inaseparate folder. Be advised that agood MetaTrader historical data take up alot ofdisk space— expect it totake up about 1 GB offree space per two years ofdata. Todownload anMT4 installation, Irecommend choosing one oftheMT4 Forex brokers because you no longer can download MetaTrader 4 from theofficial MetaQuotes website.

2. Run thenewly installed MetaTrader andlogin toyour broker's demo account. Now, close all open charts.

3. Go tothemenu File->Open Data Folder. It will bring up thefolder with all theplatform's data. Then close theplatform.

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (1)

3. Open thehistory subfolder intheplatform's data folder anddelete everything there (theactual contents ofyour history folder may differ from those you see onthescreenshot):

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (2)MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (3)

4. Run your MT4 again. Adjust theMetaTrader options toallow more bars inchart history via Tools->Options->Charts:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (4)MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (5)

5. Go toMT4 History Center (F2 onyour keyboard) todownload 1-minute historical data forevery currency pair you want totest your expert advisor on.

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (6)

6. Double-click theM1 timeframe forthecurrency pair ofyour choice (it should show empty data):

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (7)

7. Click Download— awarning message may appear (click OK if it does):

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (8)

8. After thedownload process ends, you will see some M1 data there:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (9)

9. Go toFile->Open Offline andopen theM1 chart you just downloaded thedata for:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (10)MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (11)

10. Achart will open. Find thePeriodConverter script inScripts via Navigator panel (it is adefault script provided byMetaQuotes). Run it onthechart, setting thePeriod multiplier factor depending onthetimeframe you need foryour test. Here, you see it set forM30 conversion:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (12)

11. Check theExperts tab oftheTerminal panel tosee that thescript finished its work successfully:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (13)

12. Now, if Ibacktest some EA onanM30 timeframe with Every tick model, it shows 90% modeling quality:

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (14)

Since Build 940 ofMetaTrader 4, 90% is maximum modeling quality attainable inbacktests without resorting tocustom tick data hacks. 99.9% modeling quality can be achieved byusing third-party tick data converted toMetaTrader's custom .fxt format.

Generating custom .fxt is arather complex process andthesteps differ depending onthetools you decide touse. Irecommend using QuantDataManager from StrategyQuant because it is free, lets you download Dukascopy tick data forlong periods oftime, andconverts thedownloaded .csv tick data into .fxt and.hst history data used byMetaTrader 4. Other similar tools include Tickstory andTick Data Suite from Birt Ltd.

You can discuss this and other methods of getting high-quality historical data for backtesting in MetaTrader 4 in our forum dedicated to the MT4 platform.

Did you know? MetaTrader 5 natively supports backtesting on real ticks data. Even if your MT5 broker doesn't provide quality real ticks data for the period and the currency pair you would like to backtest on, you can switch to a broker that does provide such data. There is rarely a point in using third-party data providers with MetaTrader 5.

If you want to get news of the most recent updates to our guides or anything else related to Forex trading, you can subscribe to our monthly newsletter.

MetaTrader Historical Data Importing and Converting Tutorial for Quality Backtesting (2024)
Top Articles
Latest Posts
Article information

Author: Tish Haag

Last Updated:

Views: 6064

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Tish Haag

Birthday: 1999-11-18

Address: 30256 Tara Expressway, Kutchburgh, VT 92892-0078

Phone: +4215847628708

Job: Internal Consulting Engineer

Hobby: Roller skating, Roller skating, Kayaking, Flying, Graffiti, Ghost hunting, scrapbook

Introduction: My name is Tish Haag, I am a excited, delightful, curious, beautiful, agreeable, enchanting, fancy person who loves writing and wants to share my knowledge and understanding with you.