1. General
  2. Backtest

Everything you need to know about backtesting

What is a backtest for a Stock Market Screener ?

Backtesting is the general method for seeing how well a strategy or model would have done in the past. Backtesting assesses the viability of a trading strategy by discovering how it would play out using historical data. If backtesting works, traders and analysts may have the confidence to employ it going forward. Unfortunately backtesting is not a proof and it must be used carefully.

What are the limitations of the backtest and how to avoid it ?

No backtest could replicate the futures results, but some backtesting give you interesting clue. It is hard to draw a line between a good and a bad backtest. Nevertheless, there are some question to know if a backtest is relevant or not :

  • 1. Is my database for test large enough.
  • 2. Are my results large enough.
  • 3. Does my data contains hints of future ?
  • 4. Did I separate the training and validation part ?

The 1. and 2. conditions are based on statistics. You need to have enough data to minimize randomness. For instance, if you test a strategy with thousands of conditions, and it gives you only one performing company to buy. Should you trust this backtest ?

The 3. conditions try to know if a backtest is "repainted", it means that you use (by mistake) some datas you are not supposed to know in advance. So basically, you tried to predict the future by giving some hints of the future. This is the most common mistake when backtesting and it could be really hard to find. For instance, you want to test the Strategy X on the US Market, so you decide to backtest it from 1990 to 2000. Amazing, your backtest shows that during this period, you found Apple Inc, Microsoft Inc. But, you forget that you use a current database from 2024, by doing so, you are already adding the following information in your backtest "The company is good enough to last from 1990 to 2024".

The 4. condition is something quite logic and you can find in all model creation (espacially neural network). It says that to have a correct model you need to have a separate dataset for the training and for the validation. For backtest, you should use a different period than the one you use to find your strategy.

How the backtesting is working at Guru Screener ?

At GuruScreener, we believe that users should have a complete access to data to test what they believe in. At the inverse, we want to avoid sharing performance review of strategy that may misrepresent the reality. Because everyone has a different investing style, you should create your own backtest.

For every Strategy screener, a back test mode is available. This backtest mode is like a time-travel machine at a specific time in the past. GuruScreener give you all assets that matched the strategy at this period. By selecting the assets you want to put in the portfolio, you could plot the past performance.