Friday, March 21, 2008

Q & A - How To Correctly Backtest Forex Autopilot

As you know, MetaTrader has a Strategy Tester where you can backtest Forex Autopilot expert advisor using historical price data. However, there are a couple of steps involved for a successful backtest.

First of all, you need the relevant price data loaded into MetaTrader. Whenever you trade or run an EA using MetaTrader, price data is collected and stored automatically. You can view your past currency price data by going into the History Center (F2 key). If you look at my example of the left, you will see that some price data between 13 Mar and 20 Mar is missing. This was because I did not trade during those days. As a result, the EUR/USD 1m price data was not collected during that period.
What this means is that you can only backtest for dates where you have already collected the price data. Example, if I started trading on 10 Mar and stopped on 13 Mar, I can backtest the EA between 10-13 Mar but not before or after that period. MetaTrader does not automatically download the missing price data.

Fortunately, there is a website where you can download historical price data. Visit http://www.alpari-idc.com/en/dc/databank.php to download the EUR/USD 1m historical price data for free. It's a zip file that's about 10.2MB and contains about 3-4 years worth of price data. Also, although there is a Download button in the History Center, not all brokers provide historical price data. The Download button in Alpari UK's version of MetaTrader does work and you can use that instead of uploading the data manually.

Then, go to MetaTrader Options (Ctrl-O) > Charts. You need to modify Max bars in history to 2147483647. This will allow you to upload the maximum amount of historical price data.

Then, go back into your MetaTrader History Center, double click on EURUSD and 1 Minute and click Import to upload the historical price data (.hst file). Of course, you need to uncompress the downloaded zip file first.

Now you can go to the Strategy Tester (F6 key) to backtest Forex Autopilot properly.

Modelling Quality
A lot of people doing backtesting are concerned about Modelling Quality (MQ) when doing backtesting. The higher the MQ, the more reliable the backtest. An MQ of 90% is about the maximum you can get with the Strategy Tester. The number increases with the quantity of data that you have. If you are missing some price data, MetaTrader interpolates the missing data resulting in reduced MQ.
For backtesting the EUR/USD 1m timeframe, the maximum MQ you can achieve is 25%. No, this is not an error. It's just the way the MQ is calculated in MetaTrader. You can read this article that explains why this is so => One-Minute Data Modelling Quality Rating

** Stop Spending 15 hr/day In Front of Your PC - Forex Robot Auto Trading Software **

3 comments:

Anonymous said...

I ran your exact model and got a net profit of -445.00.

Unknown said...

What were your settings and timeframe used? Every backtest I did with Forex Autopilot yielded a profit.

Si said...

Hi TJ, great blogg mate, I am emailing you from down-under (Aussie) I have many interested peoples that want to purchase from your informative site. Can you give me an email to sjv6969{at}yahoo.com.au so I may make it easier on all for purchase, Cheers. Simon