Backtesting involves using your trading strategy to historical data by analyzing the factors that influence your trading against the actual performance of the market in the past. This way you can figure out the terms and conditions which trigger these factors.
- Risk involved – for example, stop/loss
- Expected profit per trade – number of pips
- Cumulative profit goal – for example, annual return of 30%
- Time period in hours, days, weeks, months… etc
- Currency pair – USD/EUR, USD/YEN… etc
Terms and conditions which bring up these factors can be anything noticeable during the trades, for example:
You have figured out a plan to buy the currency pair as soon as it breaches the 10 –day moving average and sell whenever stochastic indicator goes below a certain level. In case you trade news, your strategy can involve, for example, buying USD whenever the consumer confidence index is on the rise.
Once you have figured out the factors and the conditions, you are ready to backtest the trading strategy. Most professional traders go through daily and weekly charts to figure out the conditions where their strategy has been profitable. By backtesting the trading strategy you increase not only the chance to win, but also your self-esteem, your confidence and your ability to stay calm during trades. You learn to anticipate the future based on the factors and conditions of the past and develop a very strong intuition for the market movements. Last but not least, you start to believe in yourself – your trading system really worked in the past, so now you know that it will work in the future.
Of course, it is time consuming and not everyone is up to it, therefore there are plenty of programs that do the backtesting for you. However, bare in mind that all successful traders backtest their trading strategies. By refusing to adopt backtesting to daily trading experience, most traders lose money.
Three main options of backtesting are:
1. Do-It-Yourself! Yes, it is extremely slow, boring and time consuming, but it is the only option which really teaches you about trading. The experience gained from backtesting is worth every minute spent. Do-It-Yourself backtesting involves going through historical data one day at a time, keeping the journal about the trading signals for the day ahead, then checking out the next chart and record the trades and signals for the next day. Open a demo account with a forex broker of your choice which accommodates backtesting software via the trading platform. Make sure that your forex boker has a good reputation and the trading platform is user-friendly. My suggestion is MetaTrader 4.
2. Automatic Software. Most favored option among traders, since it is easier then “Do-It-Yourself” backtesting. The commercial software keeps the records of the trading data (meaning that you don’t have to do all the hard work yourself). Most software makes it possible to trade in the past. Yes, you can literally trade your system for years and figure out whether the system works well on extended period of time.
3. Program Your Trading System. This option is only for computer programmers. The idea is to code a script to fetch the trades in the past according to your trading strategy. This may seem like an optimal backtesting method, but there are tones of limitations. For starters, you have to be a very good programmer! If you never had an encounter with programming earlier, it is wise to not even consider this option. It is tricky to program the precise trading system. For example, you have to figure out how to sort out European trading sessions if your system is designed to take trades only during the Asian trading session. With all the programming involved, you still have to manually check some trades to verify that the program is actually working as expected.
What can go wrong in backtesting? Why traders who backtest still fail to succeed?
The problem in backtesting is referred to as “Curve-Fitting” – the assumption that you have done the job right! Curve Fitting involves not doing out of sample tests and not doing a forward test.
Some traders optimize the results on the past 3 years sequence, however it by no means suggest that their strategy is overall optimal.
Sometimes traders ignore the possibility of randomness. They backtest it from top to bottom and it works fine, which in fact is pure coincidence that the in and out of sample data produces profitable results. Then they run the system on a real account, but it looses money.
The most common causes for the new strategies to fail in live trading include poor money management plan, building curve fitted solutions and using bad sample testing methods. Among the common causes, there is another one which is often overlooked – bad testing methods.
The reasons for forex strategy not to work and blow out the trading account within several days are bad positions and poor risk management. Below are some more reasons:
- Current market conditions do not match what you have been testing. The price directions and volatility have to be somewhat same in your backtesting as they are now.
- Your trading system has been curve-fitted and is not relevant to changing data.
- You didn’t paper trade the strategy.
- Out-of sample testing is not done enough to draw any useful conclusions.
- Risk and money management are not performing the same in live trading as you did during backtest.
- Entries and exits are not where you expect them to be.
- Some stats are out of line from the backtest to live test, which may include larger losses, smaller profits or bigger draw downs.
- Last but not least, some strategies just have as much chance of going into a flaw as turning into a winning streak.
In order to avoid curve-fitting, forex trader needs to build the strategy by optimizing, let’s say, half of the historical data. Once the optimization is done, it is advisable to run it on the remaining “untouched” half of the historical data. This way you can really figure out if something is working.
You have to understand that backtesting can lead to 20,000+ hours of testing before you actually see anything useful instead of just a random luck. From the science classes in high school we all learned that in order to make any conclusions regarding the results and their causes, you need to experiment. And only true experiments provide evidence of whether the theory works or not.