Subject:[QuantStart] Lesson 3: Successful Backtesting of Algorithmic Trading Strategies (Part I)From:Michael HallsMoore ([email protected])To:[email protected];Date:Sunday, 4 January 2015, 6:18Hi Darek,In the second lesson of ourquantitative finance email coursewe discussed how to identifyalgorithmic trading strategies and, in particular, create astrategy pipeline.In today's lesson we're going to dig deeper intobacktestingand consider aspects that are oftenignored by much of the algorithmic trading literature.Algorithmic backtesting requires knowledge of many areas, includingpsychology,mathematics,statistics,software developmentandmarket/exchange microstructure.I couldn't hope to cover all of those topics in one email, so I'm going to split them into two or threesmaller pieces. What will we discuss in this section? I'll begin by defining backtesting and then I willdescribe the basics of how it is carried out.Then I will elucidate upon thebiaseswe touched upon in the first email (Beginner's Guide toQuantitative Trading). Next I will present a comparison of the various availablebacktesting softwareoptions.In subsequent emails we will look at the details of strategy implementations that are often barelymentioned or ignored.We will also consider how to make thebacktesting process more realisticby including theidiosyncrasies of atrading exchange. Then we will discuss transaction costs and how to correctlymodel them in a backtest setting.Let's begin by discussing what backtesting is and why we should carry it out in our algorithmictrading.What is Backtesting?Algorithmic trading stands apart from other types of investment classes becausewe can more reliablyprovide expectations about future performance from past performance, as a consequence ofabundant data availability. The process by which this is carried out is known asbacktesting.In simple terms, backtesting is carried out by exposing your particular strategy algorithm to a streamof historical financial data, which leads to a set oftrading signals.Eachtrade,which we will mean here to be a 'roundtrip' of two signals, will have an associated profitor loss. The accumulation of this profit/loss over the duration of your strategy backtest will lead to thetotal profit and loss (also known as the'P&L'or'PnL'). That is the essence of the idea, although ofcourse the "devil is always in the details"!What are key reasons for backtesting an algorithmic strategy?Filtration If you recall from the previous emailStrategy Identification, our goal at the initialresearch stage was to set up a strategy pipeline and then filter out any strategy that did notmeet certain criteria. Backtesting provides us with another filtration mechanism, as we caneliminate strategies that do not meet our performance needs.