Datamining a profitable trading system is easy these days. Just take any decent platform like MetaTrader or Dukascopy J-Forex, try out some indicators and optimize the stoploss and takeprofit values until you get great results. But a datamined strategy in this manner will rarely work in practice. Traders have to be very careful when creating trading systems to avoid the common pitfalls with this process.

In this article I will present the six questions you have to ask yourself when creating any trading strategy. You will also see how I created and tested one of my profitable trading systems, shown in the picture below.

1. Are your trading rules simple?

The first question that you need to answer is, are your trading rules simple? The more variables you add, the more odds increase that the system will not work in practice. An easy way to think about this is that each new rule, whether it’s entry, exit or stoploss increases the complexity by one. For example, say you have a trading system that enters at a new 40 day high and exits at a new 20 day low. This means that you now have a total of two trading rules. Now if you add a fixed stoploss and takeprofit values, you increase the complexity by a factor of two, essentially doubling it again.

Compare this with the simple 10 SMA system I’ve presented in a previous article. Here both the entry and the exit are based on the same indicator value, the 10 month simple moving average. There is no stoploss or takeprofit attached. If prices close above the 10 SMA we go long. If the pair closes back below the moving average, we close our long and enter a short. The complexity of this trading system is one. Compare that to 40/20 day system above with sl/tp values, where the complexity is at four. At every level of complexity you increase the risk that you have datamined a strategy that will not work in practice.

2. Are you trading rules based on solid principles?

Always start with the idea, not the data. Most traders pick whatever strategy worked best in the past with no regard to whether it makes sense. My 10 SMA system above is a simple strategy designed to exploit momentum. This is a well-known and researched market phenomenon. Momentum worked for so long that now even proponents of the efficient market hypothesis have accepted its existence, although they have pejoratively classified it as an ‘anomaly’.

3. Did you optimize your trading system?

The answer to this question should be a resounding NO. Most traders go the opposite route. They test dozens or even hundreds of different indicator values before choosing the one that worked best in the past.

My 10 SMA system doesn’t suffer from this problem. The only reason I picked ten and not 9 or 11 is because it’s a good round number. If I took the opposite route and tried to optimize the moving average value, I would increases the odds of creating a system that worked great in the past but under-performs in the future.

4. Did you conduct in and out of sample testing?

With the technology available to us these days, every trader should do in and out of sample testing. This process involves splitting the data into two sets. You do the initial tests on one set of the data. On the picture below I tested 4 currency pairs from 1994 to July 2010. You can see that the 10 SMA system delivered a total of +7,255 pips during this time period. All tested pairs were profitable.

After that process is finished we now do a second (out of sample) test with the exact same settings on the other set of data, from July 2010 to now. The results are presented below. A total gain of 8,060 pips and all currency pairs showed a positive result. Note that different pairs will trend at different times, hence why the Euro was the best performer pre-2010 while the Yen took the lead during the past few years.

Significantly different results between the two sets should be a red flag. If your system works great in sample but fails the out of sample test, odds are good that it’s overly optimized to one period and will likely not work in the future.

5. How far back did you test?

The next question to answer is how far back did you go in your backtests? The more data you test, the better. A backtest of 20 years is better than a backtest of 10 years which is better than a 5-year backtest. You get the idea. Our next pic shows the combined results for the 10 SMA system from 1994 to September 2016. This is a massive 22.5 years backtest across four different currency pairs.

The data is needed because you want to see how your system performed in different market environments. During the 1994-2016 period we had it all, the 2008 Credit Crisis, the Asian Financial Crisis, rising interest rates in the 2000s and the latest period of Central Bank Quantitative Easing.

Despite all of this, the system pulled through and made +15,315 pips. Yet again all four major pairs were in the green, with a substantial profit shown in three of them.

6. Did you test other trading instruments?

Did you try your system on other currency pairs? Optimizing a system to work only on the Euro or only on the Yen is a recipe for disaster. You should be highly suspicious of a trading strategy that works only on one trading instrument.

In our previous tests we demonstrated that the 10 SMA system works on the top four major currency pairs. But why not go nuts and test the next six pairs by trading volume? The more the merrier right?

The picture below shows the same 10 SMA settings applied to USD/CHF, USD/CAD, NZD/USD, EUR/GBP, EUR/JPY and GBP/JPY. Along with the first four above (EUR/USD, USD/JPY, GBP/USD, AUD/USD), most traders would agree that these are the top 10 forex pairs. The results are astonishing and confirm what we already know.

The 10 SMA system is a robust trading strategy that showed a profit in each of the top 10 currency pairs. During the past 22.5 years, this simple system made a total of +44,383 pips across 10 forex pairs. To accomplish this, a total of only 435 trades were taken. This means that less than 1% of our trading profits would be lost to spreads and commissions. Note that rollover costs were not included in the total. This would likely be a minor drag on results because sometimes you pay the roll and sometimes you receive it.

Conclusion and Caveats

The results above speak for themselves. Any trading strategy can fail or start to under-perform at any time. But by following my methodology above you will greatly shift the odds in your favor. A system created in this manner will be robust and less likely to fail once you start to trade it with real money.

Of course there is no free lunch in trading and robustness too comes at a cost. A robust system by definition will not be optimized for any particular time period or market environment. This means that future results could vary greatly on a short-term basis, either under-performing or out-performing the long-term average.

And of course, a system is only as good as the person who trades it. Sticking to the rules during the inevitable drawdown requires discipline that not many possess. But by following a solid methodology during the creation phase you can sleep a little easier knowing that your strategy is not a datamined scrap that could stop working at any time.
Translate to English Show original