By definition, a forex trading system is robust if it remains effective under different market conditions. Robustness is what all forex trading systems should strive for. Clearly, if a profitable forex trading system can operate in various times, the profit will rise with the number of trades. Moreover, a robust trading system is to some extent immune to a sudden change in the market, meaning that risk is greatly reduced. In this article I will describe how to backtest a trading system for robustness. I will also clarify the most dangerous misunderstandings about robust trading systems and backtesting.

A backtest consists of a series of simulated trades using historical data. After a backtest, you should have a clear idea how the tested forex system would perform in the past. I never use a trading system without backtesting and I do not know any successful trader who does. On the other hand, the past performance does not necessarily predict the future performance. Backtesting is a powerful tool only if it is used smartly.

How to run a backtest? First, you need some backtesting software. There are several paid backtesting programs and the quality of their algorithms is presumably higher. But even a free backtesting program should not have any problem identifying a truly robust trading strategy. The worst what can happen is that you slightly underestimate profitability of a forex trading system because of what we call in statistics the measurement error.

The most popular backtesting program in the retail forex market is MetaTrader 4 (MT4). You can use MT4 for free. Just open a demo account with any of the forex brokers supporting MT4. The MetaTrader’s syntax is easy to learn, especially if you have experience with any other programming language. Great tutorials and a helpful community of MetaTrader fans can be found at www.mql4.com. Historical forex data for MetaTrader 4 can be downloaded for free from Alpari. An important advantage is that you can use MT4 also for automated forex trading after you are satisfied with your forex trading system.

Alternatively, you can use a spreadsheet in Open Office, MS Excel, or any similar software. Historical forex and stocks data in the spreadsheet format can be found here. But I recommend backtesitng in Excel only for simple strategies or for trading systems that use longer time frames (days or weeks). Otherwise, your task can get complicated and time-consuming.

What you are looking for in backtesting results is the win/loss ratio, which is a proportion of winning and losing trades. Another important measure is the average profit (and average loss). Risk is estimated by a drawdown, that is the largest percentual loss measured from a historical peak.

In addition to these straightforward quantitative measures, you should also examine simulated trades more intuitively. Let say, an otherwise profitable forex trading system also produced a strike of eight unsuccessful trades. When you look more closely at these trades, what market conditions were prevailing at that time? Perhaps your forex system performs badly in a ranging market. Perhaps it cannot achieve any profit if volatility is too low. Perhaps it should not trade on Monday. If you find a variable that systematically predicts losing trades, you can avoid the identified dangerous periods in the future real trading. By specifying conditions under which a trading system maximizes profit, you are doing what is called optimization.

Whenever you optimize a forex trading system using the values identified by backtesting, ask yourself two questions: First, could you predict the same result from the trading strategy itself, without looking at the data? For example, if your forex trading system follows a trend, it obviously will not perform so well in a ranging market. The system behaves as it should. But if your universal trend-following system is profitable only in a bullish market and you have no idea why it loses money in a bearish market, something is wrong. Second, do you have any strong theoretical reason why a variable should be set to a particular value and not some other value? For example, a forex trading system based on morning breakouts will naturally work in the morning and there is no reason to expect the same performance at night. It is all right. However, if you find out that for some unknown reason trades on Monday and Wednesday are profitable (on average), but Tuesdays and Thursdays produce only losers, your trading system is probably not robust. If you optimize parameters that you do not understand, you are not improving your forex system. You are overoptimizing or curve fitting.

A serious but frequent error is to overoptimize a trading system. If you have an unprofitable forex trading system, it is usually easy to find some very specific conditions, under which it would turn profit in the past. But, if these conditions are not theoretically grounded, they can be (and usually are) attributed to chance. There are techniques to fit a series of data points almost perfectly. But such curve-fitting exercise will reveal nothing about the future. You can optimize a forex trading system to produce a simulated annual profit of 1000% in the historical data only to find out that it does not work at all in the present. A robust forex strategy should be profitable under various market conditions, not only on Mondays and Wednesdays.

When you are backtesting a forex trading system, try to vary your main variables. Let us say that you enter a trade when the stochastic crosses some value. The backtesting results show that the strategy would be highly profitable if you take profit (TP) at the distance of 30 pips, slightly less profitable for TP=25 and TP=35, and still somewhat profitable for TP=20 and TP=40. The results like this indicate that your forex system is robust. If your forex system appears to be profitable only for TP=30 and not for TP=29 or TP=31, this illusory profit is nothing else than artifact of the used historical data. The most likely explanation is that there were two or more trades with TP=30 that produced profit by pure chance, though the forex system itself is a loser. There is no reason to believe that such a strategy will be profitable in the future. If a backtest shows a profit for few distant values, such as TP=17 and TP=31, but not for any other values, the strategy is not robust either. If a backtest on Alpari’s data shows a profit, but a backtest on IBFX’s data from the same period does not, the forex trading system is probably not robust. I could continue, but I am sure you have got the point.

On the other hand, it is not wise to check robustness by changing time frames or instruments. So, if a forex system uses 1-hour charts, it is not necessarily applicable to 1 day charts. If a forex strategy works with USD/JPY, it might not work so well with EUR/GBP. This is not the lack of robustness. Different markets are characterized by different patterns. Similarly, your robustness check should not go beyond what are theoretically grounded values of the variables. To give you an example, if you believe that it is profitable to buy JPY in March because carry trade unwinding tends to happen in March, there is no reason why you should test robustness by buying the Yen in April. Always stick with the theoretical basis of the trading system.


Did you like this post?
  • del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Technorati
  • LinkedIn
  • Live
  • MisterWong
  • Mixx
  • Propeller