Backtesting is an advanced tool that traders can use when they want to evaluate the effectiveness of a complex strategy or trading system. This need is not very rare, since experienced traders are well aware that jumping from pillar to post is not the best way to earn money with trading. Such a dramatic change as the one concerning the trading system must be justified by truly overwhelming evidence, almost unequivocal.
In this article, we talk about backtesting, offering an exhaustive definition and proposing a small guide for those who want to try their hand at using this important tool.
A Definition of Backtesting
The meaning of backtesting is intuitable, at least to a certain extent, from the name itself. It's a test that involves something that is now in the past. Specifically, past data. In essence, backtesting means simulating the trading activity not on the real market, but taking past market data as a reference. Obviously, it is the trader, according to the availability of the broker or any other data provider, who chooses
the period over which to carry out the simulation.
In any case, the purpose of backtesting is clear:
test a strategy on a "real" market state, even if not present. It all rests on an assumption: if the strategy works over a past period, it means it also works in the present. Where the term "work" does not mean certain effectiveness, but rather a
potential effectiveness.
In itself, practicing backtesting is not that difficult, if we exclude purely technical and IT operations to "install" historical data. After all, it's simply about... Trading. The only difficulties that are reported are of two types: on the one hand, the interpretation of the results, which is less obvious than one might imagine; on the other hand, the choice of the historical period to be used, which must be at the same time "
probative" (i.e., it must put the strategy under stress) and
realistic (similar to the current historical period, to the present).
The Parameters to Analyze During Backtesting
In this paragraph, we address the first problem, namely that of studying the results. The first step is to understand which results to look for, or which parameters to analyze. Backtesting puts the trader in front of a vast choice. The evidence it produces is so numerous as to create some disorientation. Therefore, it is better to focus on the three most important parameters. Here they are.
The Profit Factor
Many know this parameter by the English term, "profit factor". In any case, it is
the ratio of total gains to total losses. It is didactic to specify that any ratio below 1 indicates a failure of the strategy or trading system. Any method that causes more losses than gains should be put in the drawer.
But it is obvious, a profit factor of 1.1 or 1.2 is not much. So, what value should be considered satisfactory? In most cases, a profit factor of 2 should be considered satisfactory. It may seem high, but it must be said that backtesting is still a simulative practice, which is performed in a protected environment, so it is reasonable to imagine that in real trading the performance will be at least a little worse. In short, it is good to keep "wide".
The Average Trades
This is a very particular parameter, which most traders do not even consider. The expression "average trades" means
the number of market entries that a system produces. Each system has its own method for defining entries, for tracking this or that signal, and for judging it as worthy of a market entry.
Now, a trading system should absolutely not enter often, as this would cause an increase in risks. However, it should not enter
little either. If it did, the system would simply cease to be profitable, because the gains would be too infrequent. In this case, therefore, it is good to opt for a balance situation, for an average of trades as balanced as possible.
The Maximum Daily Drawdown
If you are a fan of comics, you will know an old adage of the Joker: "
It only takes a bad day to drive a man insane". Now, there is no need to panic, but in a sense the saying can also apply to traders: just a terrible day, just one trade in deep loss, is enough to compromise the trading activity.
For this reason, it is also good to identify through backtesting
the maximum daily drawdown. In short, identify the worst-case scenario. To test this parameter, you need to pay close attention to the choice of historical data, as relatively calm periods rarely produce deep losses.
The Questions to Ask After Backtesting
These parameters should be "searched for" during the backtesting activity, the results collected and interpreted. At the end of the simulation, however, it is still necessary to make a more general point, an in-depth reflection that does not see only and exclusively the numbers as protagonists. In short, it is necessary to answer questions. And not just any questions, but those that qualify a trading system as safe and potentially profitable. Here they are.
Are the results a coincidence? A question that is actually a doubt. In the worst case, a terrible presentiment. That is, the presentiment that the results obtained during the backtesting phase are actually the result of luck. If you have this doubt, if looking at the performance you notice a certain randomness, you have no other choice but to repeat the simulation, perhaps changing the historical data.
Would the system survive a market crash? In these first months of 2020, we have seen how the black swan is not a bogeyman, but a possibility. Market crashes, with or without swans, have always been there. Those who pay the price, of course, are the least prepared, least protected investors. Hence the need to ask oneself this question, and answer it
also by looking at the maximum daily drawdown, as well as the holding in the medium term.
How quickly does the system stop losses? This is a question that clearly concerns the ordinary, as losses are a frequent occurrence even in everyday trading. It therefore appears absolutely necessary for a trading system to be able to produce a sudden exit when the game gets too tough, when the hopes of gain, at least for that specific trade, are reduced. In this case, the analysis of money and risk management methods related to the trading system affect.
Advantages and Disadvantages of Backtesting
Is backtesting a useful tool? Certainly yes. Is it a perfect tool? Unfortunately not. Backtesting, like any "tool", has its pros and cons.
Let's start with the pros.
- It's probative. Sure, you will trade "in the past" but it will still be the real market. Historical data projects a true market condition, thus useful for gathering evidence.
- It is possible to test the strategy in a wide range of conditions. Obviously it depends on the offer of the historical data provider or the broker (if it offers this service), but there is no doubt that the trader still has a good choice. All this allows him to test in good and bad times, when the sea is flat and when it is stormy.
- It allows you to identify errors in real time and adjust the shot. Often problems are noticed when moving from theory to practice, so that some previously hidden elements emerge precisely during the backtesting phase.
As for the defects, there are two, of a structural nature and therefore unsolvable.
- The trader may know how it will end. Knowing what happened, how the historical data develops, can vitiate the test as it affects the behavior in the simulative setting.
- It does not take into account the emotional factor. The object of the test is not only the system but also the trader with respect to that system. Well, it risks being a poorly probative test, since it is vitiated by the absence of the emotional component: if there is no risk of losing money, then there is no stress either.
The Alternative to Backtesting: The Demo Account
Backtesting is not the only tool for testing a strategy. Certainly it is the most complex, the richest in evidence. But there is another, a little simpler, within everyone's reach, even beginners:
the demo account.
This term simply indicates
a simulative account which, apparently, allows you to trade on the real and present market, but which in reality turns out to be a simple simulation. The trader issues orders but these are not executed, also because the money is fake. It's a way to "try how you are on the market", but also to familiarize yourself with the platform, the broker and the market in general.
Its purpose is to allow beginners to practice, to complete their training path, hitherto necessarily rather theoretical.
However, it can also be used by experts, who really don't need to practice, to test strategies and trading systems. After all, it's a matter of simulating a presence on the market, and doing it in complete safety, without the risk of losing even a single euro. In backtesting this risk was eliminated by the simple fact that the market was not real, but a "projection" of a past period.
In the demo account, the risk is eliminated by the fact that orders, very simply,
are never executed. Obviously,
the results of those orders are simulated, a detail that has a value both for the beginner who wants to learn trading and therefore understand if he is prepared or not; and for the expert who has to verify the effectiveness of a strategy.
The demo account, however, has a flaw, and it's even big, if considered as a tool for use and consumption by experts. It always and only proposes the "present". You cannot put the strategy and the system under stress, unless the current state of the market is in itself in a situation of extraordinariness. It's like testing a car on a track and only one. A bit little, to collect evidence that is valid for the present, the near future and the remote future. The alternative is to wait, to use the demo account over an extended period of time, but it is obvious: the waste of time would be too burdensome.
Backtesting, therefore, still remains the best of alternatives, however imperfect. If you need to change strategy or trading system, and have a new one in your hands, then practice backtesting to verify its effectiveness.