You are currently viewing What is Portfolio Backtesting – Its importance and How to perform?

What is Portfolio Backtesting – Its importance and How to perform?

Suppose you plan to buy an expensive smartphone. Will you just go to the vendor and buy it OR look at its features and its comparison with other models before making the purchase? Similarly, in the stock market, traders and investors perform backtesting to forecast the portfolio performance before investing the real money. This is called Portfolio Backtesting.

Portfolio Backtesting


Portfolio backtesting is a popular method employed by investors and traders to analyse portfolio performance based on the historical data of the asset. It is a great way to develop an investment strategy that performs in the most adverse market conditions as well and hence, increases the chance of profitability.

The underlying concept behind the method of Backtesting is that an investment strategy that performed well in the past is expected to perform well in the present and future market conditions as well. Its converse is also true that any strategy that failed to perform in the past is likely to perform poorly in the current market as well.   

In case you want a quick overview of the topic, we suggest you check the top 5 portfolio backtesting FAQs we have added at the end of this blog.


You probably would have heard this phrase “Over 90% of traders lose money in the market”. But, do you ever take a minute to think about what could be the root cause for this? Well, it is the lack of understanding and improper research before making an investment or a trade.

This is where portfolio backtesting comes in handy, helping you safeguard your capital by allowing you to practice trades in a similar atmosphere, yet without investing in real.

Some key benefits of portfolio backtesting are:

–          It gives traders an understanding of the market conditions in the past and hence can help them make future decisions

–          It helps them develop the proper investment strategies by testing and optimising the parameters

–          It increases the chances of profitability. So without risking your actual capital, you can analyse the risks with the help of the past year’s data and can optimise your investments accordingly. This also gives confidence to the investors.


Prerequisites for Backtesting

To perform portfolio backtesting in the stock market, one must be aware of some of its prerequisites:

Correct Data

One of the crucial aspects of backtesting is data; the correct dataset leads to accurate information about the performance and hence, helps in making better decisions. As everything is data-dependent, incorrect data could lead to incorrect solutions. It totally confirms the “garbage in, garbage out” concept.

Fundamental & Technical Analysis

While fundamental analysis deals with market sentiments, technical analysis gives a forecast of the performance of the stock or the trade.

Programming Language

According to this report, around 60-75% of overall trading volume in the US, European and Asian markets is generated by Algorithmic trading. Therefore, it is important to master a programming language for Backtesting, as it can help in generating accurate trading signals. Some of the popular languages used in backtesting are Python, C++, R, etc.


A basic understanding of topics like mean, standard deviation and variance is a must before backtesting.

How to perform Backtesting?

According to CNBC, more than 80% of the stock market is now automated. It means there are plenty of tools available to perform backtesting, trading analysis and much more. However, the basic steps remain the same for all tools:

1.       Select a trading platform

2.       Select a trading system or strategy to be backtested

3.       Decide the appropriate tools or indicators to perform backtesting. Some of the commonly used indications are MA (Moving average), Bollinger bands, RSI (Relative Strength Index), MACD (Moving Average Convergence/Divergence), etc.

4.       After finalising the indicator, say Moving Average, we will decide on the buy and sell conditions with the help of coding

5.       For example, if the 50-day MA is greater than 200-day MA, then we will buy, and if the 50-day MA goes below the 200-day MA, we will sell or short.

6.       Now, this setup or strategy is tested over several stocks to validate it.

Once the process of backtesting completes, you are ready to implement it in the real market to assess your strategy.

However, there are some popular metrics to analyse your backtesting results:

Annualised Volatility: It is defined as the standard deviation of the returns of the investment and is a measure of risk.

Drawdown: It is referred to as the downfall of the price of the stock from its peak to the bottom in a specified time. If you are worried about the maximum loss, Maximum drawdown can be a good risk indicator.

Sharpe Ratio: It is defined as the ratio of returns per unit risk. It is considered one of the best risk indicators.

Beta: It is used to assess less risky strategies and is defined as the ratio of covariance of market and portfolio returns to the variance of the market returns.


Portfolio Backtesting is a great strategy used by traders and investors to analyse the performance of the portfolio based on historical data. It is always better to have a diverse allocation of assets to leverage the market volatility and hence increase your profitability. While backtesting can be a helpful strategy, it does not guarantee success in the ongoing market, as the backtesting results are mostly based on historical data.


  1. What is Portfolio Backtesting?

Portfolio Backtesting is a popular method used by professional traders and investors before investing. The performance of a portfolio is studied based on historical data, and hence, future decisions are made accordingly.

  1. What are the prerequisites for backtesting?

To perform backtesting properly, one must have sound knowledge of trading psychology, market segment, fundamental & technical analysis, chart patterns and programming languages.

There is a very important word here – “backtest”. And in this scenario, you backtest your stocks. There are a few programming languages used for backtesting: Python, C++, MATLAB, and R. 

However, it’s not a mandatory requirement for backtesting. Every programming language comes with its own advantages and disadvantages. You can also start with Microsoft Excel.

  1. What are some important parameters for analysing portfolio performance?

Some common performance metrics are Cumulative Returns, CAGR (Compound Annual Growth Rate), Annualized Volatility, Drawdown, Beta, Sharpe Ratio, and Risk/ Reward Ratio. 

  1. What is the minimum number of trades for backtesting?

There is no ‘ideal’ count for the minimum number of trades required for backtesting. One needs to be fully satisfied and confident with his/her strategies before performing a live trade. However, the more the number of backtests, the more the chance of success.

  1.  What are some risks involved with Backtesting?

While backtesting can be a helpful strategy, it accompanies some risks as well. As backtesting results are dependent on detailed historical data, it does not completely guarantee success in the current market. It also causes issues like data bias.

Also, while performing a real investment or trade, one may incur fees which is not the case in backtesting. Hence, the profit margin may get affected.

Also, many individuals point out that past performance is not indicative of your future outcomes. Past strategies also sometimes fail in the future.

Leave a Reply