The Importance of Testing with Tick Data

Before I go on to further testing, I just want to do a short write up on the importance of knowing what your data represents and ensuring that it is good.

Using MT4 as an example, a normal Strategy Tester run using the standard historical data will give you 90% modelling quality. 90% sounds good – in a modern world, scoring a 90% on a quiz means you get an A+ – but MT4 testing does NOT work that way.

One important thing to know about the standard data you download from MT4 is that it is using interpolated data. What this means is (broadly speaking):

MT4 takes 4 price points – bar open, bar high, bar low, bar close – and then – for lack of a better team – estimate how prices move based on these 4 price points. If you have ever plotted points on a graph and try to draw the “best fit” curve to fit those points, you know what MT4 is kind of doing with the data.

The problem is, of course, prices do not move in a predictable “best-fit” manner that can be estimated with a software. Real price movement can be very hectic even within a single bar. If you use interpolated data in your testing, you are effectively using estimated, “predictable” prices to gauge if a strategy will work or not, instead of using real price tick data. Most strategies perform better when prices are more predictable; and do much worse when using more realistic prices.

To illustrate with an example, I ran a quick backtest with the Bolinger Band Strategy from my last post [ http://asimovanalytics.com/2020/11/prelim-test-bollinger-band-strategy/ ] but using the default MT4 data.

(sorry for the small text – but you can see the equity curves in these examples)

The results? Well, it sucked, but not too much. We’re almost back at breakeven. The curve is actually pretty smooth after the series of losses in the middle – you can imagine that we will be turning a profit in about a couple more trades.

Next, we do the same test, same period, same settings, but now with proper tick data with variable spread and slippage factored in:

AND IT TOTALLY BOMBED.

Now imagine if you were to do your backtests using the default data instead of tick data, took a strategy that looks good on that, and went on to trade real money with it. I think you understand the risk involved at this time.

The next question is, how do we get proper Tick Data?

If you are keen, I would recommend Tick Data Suite from [https://eareview.net/tick-data-suite]

They have quite a number of good things going: they offer data from various sources; including Dukascopy tick data which is generally considered the gold standard. If you prefer data sources from elsewhere, you can get data from FXCM as well, amongst others. You can see from the screenshot above that it also lists all the data you downloaded in a nice, neat list, making it easier to manage than even MT4’s own interface.

Once installed – it automatically and seamlessly integrates with MT4, so no headaches on that end.

As you can see, the “Spread” option – instead of having you choose a fixed number now becomes “Variable” – to reflect the spreads more accurately according to what actually happened in the markets.

There’s also a selection of additional settings, but the most important one, I feel, is the ability to factor “Slippage” into your backtests. As you can see below – the slippage settings I use is pretty crude – there’s a 20% chance I will get 10 points in my favour, and a 80% chance I will get 30 points against me – each simply evens out to an additional 2 pips lost per trade.

It is basic, but it’s just the one I use. There are more sophisticated options to simulate slippage as well.

Basically – I find it a great tool to use, and a must-have if you are planning to automate your trading using MT4. The price point is quite reasonable a swell, a $97 upfront payment with a $10 monthly subscription.

You can find Tick Data Suite here:

https://eareview.net/tick-data-suite

How I Do Preliminary Testing

When we first get a new EA; we need to backtest it to make sure the trading idea is solid and really works in the markets, no matter how good the idea may sound on paper.

  1. Make sure the Code works

Using MT4 as an example; the first thing I do is to run a test through Visual Mode: and make sure all the trade entries and exits occur when I expect them to. If not, we need to find out why exactly trades are not triggered according to the specifications. There could be multiple reasons why this occurs – either the code is really faulty, or my interpretation of the EA’s rules itself needs to be refined.

2. Choice of Parameters to test for

The next step is a bit more general: I would take a look at the EA and try to determine which parameter inputs will have most impact on trading results.

There’s a systematic way to do this; but at this stage I’ll just wing it and go with those that seem most important.

For example: if I am testing a Moving Average cross EA, I’ll maybe choose the MA inputs to the most important things that affect profitability. The truth is it is entirely possible that your Stop Loss and Take Profit settings will impact your results in a huge way as well – but for a prelim test I’ll let that slide.

I may choose like 2-3 parameters that seem important, and also reasonable starting / step / ending values for them. Keep the number of values to test for each parameter roughly constant – if I test for 5 values for Moving Average 1 (eg, 10,20,30,40,50), I should also test for about 5 values for Moving Average 2 (eg, 60,70,80,90,100) and not like 20 values.

3. Testing!

 Finally, I run an Optimization run for maybe about 2 years of data over the 7 major forex pairs. MT4 optimizations take time to run; so I don’t get too overboard and optimize over a long time like 5 to 10 years. For EAs; I start with Daily timeframe – most EAs are built using simple rules – and it is my belief that simple trading systems work best on higher timeframes where there are “less noise”.

The issue with daily timeframe is that you need a longer testing period to generate enough trades to be more confident of the results, so the initial 2 years may not be enough. It’s fine for now – if the strategy cant show promise even over a shorter time period, I don’t think it’s going to show much improvement if I change the period to five years or more.

4. First Interpretation of Results

After exporting MT4’s Optimization Results to excel; I first take note of the following:

  • What is the % of winning runs over the total number of runs? A sound trading strategy should not be dependent on having exactly the correct set of inputs to be profitable; ie – it should be good over a wide range of parameter sets. In this case, at least 30% of your passes need to be profitable, or there might be something fundamentally wrong with the trading idea.
  • On a similar note; good trading ideas also ought to work over a wide range of markets. If something is only profitable on say, USDJPY and not on any other pair, there needs to be a really good explanation on what makes USDJPY so special with regards to that strategy – else it might just be a fluke.
  • I don’t really look at profit factor – but instead, I use a calculated metric: Profit/ Maximal Drawdown (or PMDD). The higher this number, the better, but we are looking for results where there are many instances where PMDD is more than 1 – what this means is not only your pass is profitable, but also the profit is more than the potential losses in that same period.

And that’s about it – these are just meant to be a prelim test, I’m basically just seeing if a strategy has the potential to be good or not, so my criteria isn’t too stringent at this point – in fact it’s actually quite lax. If it passes this stage, we can go on to see if there’s any scope to further development – but if a strategy doesn’t even look good here, chances are it wont look good under closer scrutiny as well.

The main point is – evaluating a strategy / EA isn’t as straight-forward as just running a backtest for the past X number of years and see that it generates a profit – there’s a bit more nuance than that.

I hoped this article is useful to you – thanks for reading!