About backtesting

What is

Backtesting is the process of testing a trading strategy before using it. It allows the user to know if the approach they are using is correct and if the model has the desired coverage. This tactic must be done regardless of what we want to negotiate, whether in the market for stock indices, raw materials or foreign exchange. It is a question of slowly looking at what would have happened if we had acted in a certain way to check that the strategy (trading system) employed will work in the future. This would simulate conditions past with sufficient detail. This makes one of the limitations of this method the need for detailed historical data. Another constraint is the inability to model strategies that could affect historical prices.

For what it is

The aim of all this is to assess the effectiveness of our tactics and system. Experts say that, as a rule, our system will work three to eight times less than the backtest we perform. I mean, for our system to work for a month or two, we should backtesting for eight months. The more time we spend on it, the more confidence and certainty we will have in our system. In this way, backtesting will not only help us make sure that our system will generate benefits, but will also help us strengthen our psychological disposition. One thing to keep in mind by the trader who wants to do a backtesting is his level of experience. It’s not the same being a rookie as an experienced operator.

Checking our tactics in real time would take a long time, as well as not being very productive or systematic. This is why strategies are often tested in historical data. Thus, we will get a source of abundant information essential to our next maneuver. In order to establish our strategy, we must operate as far as possible with stipulations that are as similar as possible to those we are going to use in reality. In addition, there are a minimum of operations that we need to perform to ensure that the pattern we use is reliable and there are no coincidences. This would be around two hundred and three hundred operations.

How to do it

In order to do a backtesting we must first have a strategy that we want to measure. This has to be sharp and must detail inputs and outputs in a specific way. We should try to be as neutral and objective as possible. In addition, only indicators should be used to enter and exit. Another important aspect is that the strategy to be evaluated does not have excessive indicators. The only thing that will make us hold too many indicators will be to stop multiple entries and fill the market with adulterated inputs. After that, the pair of currencies to be assessed and the time space to act should be chosen. It is possible to choose the American, European or Asian schedule.

It will then be possible to create an Excel template showing different particularities according to the method, such as the entry or exit price. Between the two prices will also show the maximum earned and lost. This information is of crucial importance for our analysis. Thus, all Maxima obtained could be separated and collected to obtain the statistical mean and its standard deviation. In this way we will see with certainty where the greatest density of these maximums. The same will happen on the side of maximum losses. Another fundamental aspect of backtesting is when it is done. It is important to develop it over a period of time that is relevant, if it is not serving for little.

Manual mode

There are two different ways to backtesting. The first is manual, also called papertrading. This method is based on looking for graphs from previous months gradually and registering pips for and pips against. In addition, loss capital and profit capital should also be recorded. In favor of this way of doing backtest is that the user is effectively internalizing his own strategy, on the contrary, it is a method that is complex to optimize, besides being quite slow in what development entails.

Automatic mode

The second procedure is automatic. In this way a strategy is initially programmed and, once completed, we backtest from the pasado.De this way, the tester of the strategy we implement will point out the pips in favor,the pips against and the average benefit we get, among many other data. As a negative point, to do so automatically you must have a broad knowledge of programming. So we can test our own strategies. In addition, it is quite simple to overoptimize a strategy, that is to say, to carry out a tactic that can only be carried out positively at a single moment in the past, but not in the future.

About the author


Leave a Comment