Forex 103 – 99% Backtest Modeling for Beginners

Filed Under (Journal) by Casey on 18-12-2011

During my recuperating month, I have been going back to basic. You know as they say “When all else fails, go back to the basics of it all”.

And I have been going back to basics. Learning everything all over again. And one of the things was to learn how to do is 99% backtest modeling.

I have been gawd dang lazy and have been procrastinating this particularly simple task. It is simple, but I found it a bit tedious or maybe overwhelming. Whatever the reason it may be it was just an excuse for me to not do it. Don’t know why? And don’t know what?

But… I finally got my ar$e to really do something about it. Better late then never as they say…

Now take a look at Brit’s page here on tick data, it’s just crazy with information. Crazy as in a whole loads of information. I have also bought myself into Rob Casey’s “Guide to Getting Rich with Forex Robot” which also explains about 99% backtesting in a more simple and visual way. Even with Rob’s video steps, I found it a bit of a challenge…

If you are not overwhelm with the information written on Brit’s page… then you are probably a veteran and knows most of what he is talking about. If you are overwhelm, you are not at fault. It’s just that we have not reach that stage just yet.

Rob Casey’s guide was must more simple and with video on how to do it step by step… I found it easier to understand. However, when I want to go back to a point where I was stuck… I have to play the video over again… From the start! And I have to wait for the buffering to reach that point before I can see where I did wrong. That was pretty annoying.

He also had a step by step guide… But sometimes without the visual, I do not know whether I was doing it right or wrong.

So… after learning and doing a few 99% backtest modeling on some EA. I got the hang of it. And I though it will be a great help to all newbies if I share with them my easy understanding of both these two sites about 99% backtesting.

Before I continue, I just want to say that this is what I believe to be the most simplest form a step by step. It’s just a do and follow the steps A, B, C, D, to get result E. ¬†There are no additional information as to why and how and what. All this information has already been very well written in Brit’s page. Take you time to read, learn and understand more if you want.

But if you want to get down and dirty and start doing some 99% backtest modeling… Then continue on…

Here you go… 99% backtesting the straight forward ABC steps without the heavy information.


Downloading Data

The easiest way to download tick data is via Dukascopy.

Just open a demo account. Then you have 14 days to download all the data that you want. One thing I must point out is that the data that you will be downloading is relatively huge. To give to you an idea, just 10 currency pair per year took up about 2 days of continuous downloading.¬† So if you are going to download all the currency pair… then 14 days might probably be enough.

Ok… I download only 10 popular currency pair over 3 years 2009, 2010, 2011. At the time of this post I am trying to download 2008.

Oh… you also need to have a relatively big disk space it’s close to 10GB per year for 10 currency pair. It’s more or less 1GB per currency pair. Some are more some are even as small as 500M. So over 3 years for 10 currency pair would equal to 30 GB of space.

1. Register a demo account with Dukascopy

2. Download JForex, it’s a Java base platform. And that is where you are going to download your data from.


3. Once you have log into your demo account. Go to ‘Tools’ and click on ‘Historical Tester’


4. A tab at the bottom of the platform will appear


5. Follow the 1, 2, 3, 4 steps as shown in the picture: 1)Set the Currency Pair you want; 2) Make sure it set to ‘ Tick ‘; 3) Select the period; 4) Then click ‘Save Data’

A thing to note for item 3, you can either download every 2 year period, or if you prefer download base on each year period. If you download every 2 year period, it’s going to take a bit longer than expected. For personal reason and preferences, I download base on each year period.

6. Once you click ‘Save Data’ you will need to save it into a folder. Do not rename the file.

You can save and organize your download base on currency pair… Or if you like me, organize it base on the year period.

7. Next… make yourself a cup of coffee and do other stuff. Like continue to read my other interesting post on my blog. Or you can do things more interesting like watching the download of your data.

Converting the data to an FXT format

If you have bought into Rob Casey’s guide and have downloaded the script. Forget it and delete it. Brit’s script is good enough and of course it is FREE.

Download it here (Brit’s Site) or you can download from my site here. For my version, I have taken the liberty to only zip up the files that you will only use. Brit included other scripts for other broker. So to not confuse you like I was previously, I only give you what you need to move forward.

1. Once the script is downloaded, upzip the file and copy everything into your MT4(C:\Program Files\YourMetaTrader \)

2. Now select the currency pair with it’s year period you want to you from your data folder.Example EURCAD_Ticks__2010.01.01_2010.12.31.csv and copy it into the folder (C:\Program Files\YourMetaTrader \expert\files\)

3. Rename it to EURCAD.csv [Note: You can only do one currency pair at a time. Brit’s script does not allow you to do two or more currency pair at a time. Thus ensure that you only have one currency pair in that folder.]

4. Open your MT4 platform and then open the currency pair chart. In our example it would be EURCAD chart.

5. Before you start the script. Select the timeframe which you want on the chart. Example: You want to backtest later an EA which uses EURCAD on a 15 minute chart. So select 15M on your chart.

6. Once that s done, move or start the script JForex2FXT on the chart. There are a few configuration which might only be interesting to modify

Spread, PipComission and Leverage. You don’t have to worry about the other settings.

For spread, if you want to the spread to be 2. Just enter 2. It does not matter if it’s a 4 digit or 5 digit broker.

For PipComission, insert value only if you are using ECN broker and want to incorporate the commission. Otherwise you can ignore it.

Next is Leverage. Change this only if you want to see the effect of increasing leverage vs increase lot traded. Otherwise maintain it at 100.

So typically it’s just modifying and setting the spread value.

To confirm that the script is working. Look into your expert log.

Then you have to wait. A confirmation window will appear once the conversion is done.

7. Apply Birt’s patch script.

You need this magic script applied before you can use the FXT files. This script basically make the FXT file un-writable when we start our backtesting. Usually when we start our backtesting on the MT4 platform the FXT always rewritten.

So this magic script must be applied before you go onto the next step.

Now this script is the magic script which YOU MUST apply it every time. If not your backtesting will not work.

8. Move/Copy the FXT file from C:\Program Files\YourMetaTrader \expert\files\ to C:\Program Files\YourMetaTrader \tester\history\

9. You are good to go… Just run your backtesting exercise as usual… When you want to do another test on another currency pair or another time period. Just start again at number 2 [Converting the data to an FXT format]


One of the main problem if you are using Window Vista or Window 7, is that if the MT4 keeps rewritting a new FXT or overwriting the FXT file even after you have applied birt’s script and you have copied into the history folder. Then it means on of the User Account Contol (UAC) setting in Windows is enable.

You have to unable UAC setting. You can unable this by going to your ‘Control Panel’ then click on ‘User Account’ then click on ‘Change User Account Control Settings’

Move the level to Never Notify. That would solve the problem.

Note: If you do not have a good anti virus program. Disable this only when you want to do 99% backtest modeling. Once you have done your backtesting you can set it back to the default level. It might help that when you disable the setting to do backtesting. Do not visit any p0rn sites or download anything from the internet, stay safe when surfin. You don’t want your computer or laptop to hang or crash on you when you are backtesting do you.

Well… I do hope you find this post helpful and easy to read and use when you want to do you 99% backtest modeling.

Once you get the hang of it and want to advance your understanding, then I again suggest you to read Brit’s page on Tick Data. All your questions can easily be answered there. Thru patient reading.

So there you have it…


Be Sociable, Share!

Post a comment

Anti-Spam Protection by WP-SpamFree