Trader’s Tech – Writing Your Own EA Part 37 – Strategy Tester

Forex RobotI think we’re going to float away in north eastern Indiana! It feels like it’s rained continually for a week here on the farm. I suppose that’s better than the 100 degree heat we’ll be experiencing in Texas shortly. I hope everyone in the US had a wonderful Independence Day weekend. There were LOTS of fireworks all around us here – or maybe we could just see lots of fireworks because it’s so flat.

If you’re new to this series and want to check it out from the beginning, you can find that here. And look here for a list of all the programming articles.

In Part 36 we started talking about using the Strategy Tester (ST) for optimizing your EA. We’ll continue that discussion today.

Before we get started, I just noticed that build 509 of MT4 was just pushed out and the ST has a new option:


Trader's Tech - Strat Tester 8

You can now select the spread the ST will use when you run your test. Different spreads can make a huge difference in the performance of your EA, so be sure to pick the highest spread for your test that you expect to see during the live operation of your EA.

After your optimization test series is complete, you’ll notice a couple of new tabs at the bottom of the ST:

Trader's Tech - Strat Tester 10The Optimization Graph tab gives you a quick overview of the results of the optimization in grid form. The darker the green, the more profit was realized from that particular combination of parameters. The bottom of the chart shows the values of MA1, the right of the chart shows the values of MA2.  This graph actually suggests to me that the most profitable MA crosses are when a smaller MA crosses are really large one.  That makes sense, since the smaller MAs more closely approximate actual price action and most traders consider a price action cross of a longer term MA a serious event. This also makes me feel better that the positive results seem to be clustered around our most profitable combination of parameters, which suggests to me that we’re not just picking parameters that produce a few very profitable outliers, but that the strategy may actually be sound.  Do remember, though, that profitability is not the only measure of success in a back test.

Trader's Tech - Strat Tester 9The Optimization Results tab shows you the actual numbers (initially) sorted by profit with the most profitable combination of parameters at the top. The rightmost column shows the parameters that were used to get the results for that particular row. As I mentioned above, profitability is not the only measure we should use to pick out optimization. You’ll note that we had pretty wild profitability in pass 4, but we also had humongous drawdown of 33.38%. Another interesting piece of information you can see here is the number of Total Trades. Our most profitable combination of parameters shows 167 trades and the next most profitable shows 152 trades. I believe I would want more information about these two different combinations. I would want to look at those 17 trades and find out what makes such a big difference between these two combinations. You can run a full test on one of these parameter sets by right clicking on the row and selecting Set Input Parameters from the resulting context menu. The window will switch back to the Settings tab and the Input Parameters from that Optimization row will be set to run. Click Start and you will get a test of the parameters you selected. When the test is complete, you can see the Results by clicking the Report tab.

Trader's Tech - Strat Tester 11The Report tab will show you all the data you could ever want to know about this trade. I do want to draw your attention to the Modelling quality in the upper right corner, this shows the quality of the data you are using. As you can see, my data is not very good. You should get 99% Modelling quality. I’ll show you how to do that in a future installment. For now, I just want you to familiarize yourself with the interface. You can right-click on the report, select Save as Report, give it a name and it will save the report as you see it, with a detailed list of trades and a list of the parameters used. When I get close to the parameters I want to use for my EA, I save several of these reports.

That’s it for today. Next time we’ll talk more about the ST report and what information can be gleaned from it.
Thanks for your attention and please follow me on Twitter and LinkedIn.





The following two tabs change content below.
Winners Edge Trading was founded in 2009 and is working to create the most current and useful Forex information and training available on the internet.

Winner’s Edge Trading, as seen on:

Winner's Edge Trading in the news