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.
3. Open thehistory subfolder intheplatform's data folder anddelete everything there (theactual contents ofyour history folder may differ from those you see onthescreenshot):
4. Run your MT4 again. Adjust theMetaTrader options toallow more bars inchart history via Tools->Options->Charts:
5. Go toMT4 History Center (
6.
7. Click Download— awarning message may appear (click OK if it does):
8. After thedownload process ends, you will see some M1 data there:
9. Go toFile->Open Offline andopen theM1 chart you just downloaded thedata for:
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:
11. Check theExperts tab oftheTerminal panel tosee that thescript finished its work successfully:
12. Now, if Ibacktest some EA onanM30 timeframe with Every tick model, it shows 90% modeling quality:
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
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.