The so-called backtesting, or testing of your trading strategy, is the alpha and omega of the entire trading business. Only at this final stage will you find out if your strategy really is profitable or not. Let’s start from the beginning though. I’ll show you what backtesting is, how it’s done and what you can learn from it.
I’ll even show you the results of my own backtesting. So, let’s do it.
What is backtesting?
Backtesting is the testing of a certain trading strategy based on historical data, and thus, the verification of profitability on real price movements from the past. So, consider a graph for the last year. From the graph, you can read the moment you’d enter the trade and how it would have turned out.
Why is quality backtesting so important:
Trough high-quality data, a representative sample, you will learn how the strategy would have turned out if you had already used it – a year, two, three, or maybe ten years ago. At the same time, you will find the trading strategy’s greatest weaknesses, learn what could be improved, where to set a stop-loss and when to take profit.
Your trading strategy should be built on a logical basis. However, only backtesting can fine-tune it and adapt it to your chosen instrument. While one strategy may theoretically work on a pair of EUR / USD and gold, it will hardly have the same parameters for taking profit or stop-loss options. And these are the determining values.
How to perform backtesting
First of all, you will have to come up with a trading strategy or at least with some sort of an idea of a strategy (I will provide you with one below). It is up to you whether you use automatic testing in the form of a strategy tester or another tool, or if you choose to do it the old fashion way, using just pen and paper (although today you may want to use Excel instead).
The different testers are great, as they provide very quick results of your strategy on basically any data sample. After all, you can check out our older article about the strategy tester in MetaTrader.
Personally, however, I think that automatic testing is not free of certain obstacles:
You must be able to rewrite the strategy into orders according to the appropriate convention
- Not everything can be entered into the system
- You lack visual control and experience
- You must be able to rewrite the strategy into orders according to the appropriate convention
You may have a different opinion on this, but personally, if I don’t want to create an automated trading strategy, I prefer to go through the trades one by one. Why? Because in the end, it will be me who will enter the trades again, not the computer.
Benefits of manual backtesting:
- Trading strategy experience
- Visual recognition
- A better experience with market behavior
- In general, a lot of “seen graphs” and experience
With backtesting, it is the experience with the trading strategy, its easy visual identification and the experience with the given market that is priceless. A quality backtests can provide you with an incredible amount of experience, which you’ll surely appreciate in real trading, where a slight nervousness comes into play.
Example of backtesting
Personally, I am a fan of simplicity, and so in my repertoire, you can find even some very primitive trading strategies, for example, a very well-known strategy for filling the gaps when the market is closed. In the forex, this usually means the weekend.
I backtested this strategy early in 2015 and decided to check 100 trades back to EUR/USD. I had only one condition -the gap being greater than 5 pips, otherwise, it was not even worth entering the trade due to fees. Take profit was set to fill the gap and stop-loss to unclear.
I wrote down the results three times, if the stop loss was 10, 20 or 30 pips, to see what would perform better.
I went through each trade, one by one, calculated the difference between the opening and closing price in points and wrote down the results in Excel. From this I got this result:
The chart above shows that the strategy was profitable in all cases, but the biggest profit came with the SL = 10 pips setting(take profit always fill the gap).
Then I calculated the trade costs, found a broker with fixed fees and finally subtracted 200 pips, still leaving with a decent profit of 208.5 pips on 100 trades. I could declare the strategy profitable and start trading it. This was 5 years ago, and to this day I am still trading using the very same strategy.
This strategy is not one of the best strategies in the world, but it is profitable.
I’m not forcing you to trade with this strategy. I just wanted to show you the way and, specifically, my way. Although I liked the simple idea, I didn’t trust the strategy. It just seemed too simple. So, I tested the strategy on historical data and determined which stop-loss was the best.
Although it may seem easy, even such a simple backtest as the abovementioned can swallow your whole afternoon. However, it pays off, as the experience gained is priceless.