Assess the viability of trading strategies with backtesting

And why is it so important?

Pooja Porwal
The Capital
4 min readJul 19, 2020

--

Illustration 1: Backtesting strategies and why is it important?

Backtesting is an important step in optimizing a trading strategy as it assures the traders that the strategy is fundamentally strong and could yield profitable outcomes when implemented in the live market.

In this article, we will discuss the basics of backtesting, the difference between backtesting and forward performance testing, and by the end of this article, we will also backtest a few strategies using the Streak platform.

Backtesting is a popularly used step and an important tool in traders' toolbox, without which it is risky to dive into the market. Think about it — be it a mobile phone, car, or any other product, we first check the history of the brand, features and then check if it’s worth your money. The same applies to stock marketing strategies.

What does backtesting mean?

Backtesting is a process of testing a trading hypothesis on a previous time basis, in simple words, backtesting is assessing the viability of a trading strategy using historical data to evaluate the profitability of the strategy, and how the strategy would operate in the live market. So if you have a trading strategy and are planning to go live, backtesting will help you reappraise the performance and potential outcomes of that strategy for a particularized period.

So how does backtest work?

When you have a trading strategy that abides specific criteria for entry and exit conditions of a trade, for a pre-determined period, a backtest will run that strategy for the period specified. The stocks matching those conditions (for the period specified from a group of stocks) will be put into your portfolio and a profit and loss statement will be furnished likewise.

This will help you evaluate the performance of the strategy without engaging any capital. You can choose to deploy the strategy in the live market based on the viability of the backtest result. Simply to say, you would have incurred similar results if you would have gone live with the strategy. Needless to say, past performance does not guarantee the future performance of the strategy, as it only presents only a predictive picture of how it could perform in the future.

How is backtesting different from forward performance testing?

Typically known as Paper trading, it enables a trader to evaluate the variability of the strategy in live market conditions (unlike for a predetermined — prior time in the case of backtesting) allowing the trader to validate the strategy for current market conditions without actually taking the trade positions. Paper trade is a trading hypothesis whereby, we replicate the live market trading with virtual money. It acts like a stock market simulator.

Backtesting with Streak

This is the backtest result of a simple VWAP strategy for educational purposes only*. I have deployed the strategy with a stop loss and target price of 1% each on a 1hour time frame.

Illustration 2: Backtesting using Streak Platform

The backtest results include the P/L curve, maximum gains/losses, average gain per winning trade, the average loss per losing trade, maximum drawdown, and much more. These metrics give you a comprehensive idea of your strategy’s performance before you deploy it in the market, we can see the details of these metrics with the embedded results below.

Illustration 3: Detailed metrics of backtesting results

To run a backtest on your trading strategy you must first set all the criteria for the strategy by specifying the quantity, stop loss percentage, target percentage, order type, backtest period. Run the backtest to observe the variability the strategy with Streak.world

The bottom line

Backtesting proves to be one of the biggest advantages of Algorithmic Trading since it allows us to test our strategies before actually implementing them in the live market. Backtesting is a quintessential part of trading as it enhances the profitability of the portfolio by letting us observe the performance of a strategy with historical data. Positive results and good correlation between in-sample and out-of-sample backtesting and forward performance testing increases the probability that a system will perform well in actual trading.

In the next article, we will discuss the intricacies of backtest results and how to decipher them by putting more light on average return, maximum drawdown, winning streak, and more.

--

--

Pooja Porwal
The Capital

Fintecher | Global Payments | Making Web3 safe | Blockchain | DeFi