How to Back Test a Strategy in Metatrader.The following is Vassilis’ entry for the summer competition. If you are trying to test a strategy & especially an ea or robot, then it is vital that you test it both in current “live” markets & just as important, look and see what happened in the past. I am technically hopeless and usually get people to do this kind of stuff for me, but I just had a play, following Vassilis’s article and IT WORKS!
Backtesting
When you are given a new system it is good to be able first to test if the system works and second to learn the system. In order to do this you have to be able to back test the system manually. Of course it cannot replace real life conditions but it is the next best thing to do. With real life conditions maybe you have to wait days before something happens. With back test you can fast forward the candles and when there is a setup stop candle display and analyze the setup. I decided to write a manual instead of creating a video because it is going to be easier to print the manual and follow the instructions instead of viewing a video and try to remember all the steps.
One easy way to do the back test is set the auto-scroll off and scroll back your charts . Then you can move one candle at a time pressing the F12 key (by the way Shift F12 will hide the current candle). This has a drawback. You can always “cheat” and see the next bar.
One more thing that I find very useful. There is a small grey triangle at the bottom left side of the screen (shown by the red arrow). Now let’s say you move the grey triangle under a certain bar, it could be the 15min bar at 7 am of July 9th. Now if you change the time frame the chart will ALWAYS be centered at this 15 min bar. If you show the monthly it will the month of July above the gray triangle, if it is the daily it will be the 9th of July if it is a 1 min chart it will be at 7:01 (the 1st bar of this 15 min period). This is a very nice tool but the auto-scroll button must be turned off.
Now let’s see at a more sophisticated way to back test our system.
Metatrader has a built in strategy tester that we are going to use.
I do not think you have to go back 5 years or 10 years to do the back test. Select a period of 2-3 months. Normally back testing is used to prove the profitability of a system and learn the system. In our case since we know that Marc’s system is solid we are going to use back testing to train our minds and skills.
First it is a good idea to print the calendar of events. To do this you go to forexfactory and select this week instead of Tomorrow or Today. You will find this at the upper right part of the calendar screen, just above the Actual Forecast Previous columns.
After you select week you will see the calendar of the current week. If you want you can sele ct filter (it is above the Chart column) and set it to the red factory only. That way you will only display the important news.
Then from the left part of the screen you select the first week of the period you want to check and you print it selecting Print Current View. Then you select the next week and print it etc. You now have a list with all the events for the selected period. You could fold the page and hide the results but anyway we all know by now that news move prices not in the way they should (lol). This printout will help us avoiding enter a trade when important news are due.
Next we are going to work with the Metatrader. I suppose that you know the basics about adding indicators, using templates etc so it is not going to be a guide for a complete newbie.
I would suggest that you open a new demo account in case you mess things up. So after opening your platform go to Tools/Options/Charts and change the max bars in history AND max bars in chart. Just keep pressing the 9 till you hear a bell. Then you press OK. If you open the options box again you will notice that MT4 put the maximum number allowed.
Then you have to download the data for the specific pair. To do this from the main menu you select Tools and History Center.
You will see something that looks like the above picture. You select the currency pair that you want to use in my case is Aud/Usd and because there is no data for this pair all time frames are gray. Then press Download. You might get a message like the following one.
Press OK and continue. You will see a green bar that is getting filled as data is downloaded. Since we are not working with a robot that is pip sensitive small differences between brokers are not important.




LinkBack URL
About LinkBacks






Reply With Quote


