Financial Market Microstructure and Trading Algorithms
Total Page:16
File Type:pdf, Size:1020Kb
Financial Market Microstructure and Trading Algorithms M.Sc. in Economics and Business Administration Specialization in Applied Economics and Finance Department of Finance Copenhagen Business School 2009 Jens Vallø Christiansen Submitted January 9, 2009 Advisor: Martin Richter 1 SUMMARY The use of computer technology has been an important part of financial markets for decades. For some time, banks, hedge funds and other sophisticated market participants have used computer programs, known as trading algorithms, to trade directly in the market. As electronic trading has become more widespread, computer‐based access to the markets has become more broadly available as well. Many banks and brokerages offer their clients, including private investors, access to the financial markets by means of advanced computer systems that route orders to the optimal price. The consequence has been increased trading volume, better liquidity, and tighter spreads. On major stock exchanges such as NASDAQ in the United States, trading algorithms now represent the majority of daily volume. This means that the majority of trading takes part without direct contact between human traders. There are two main types of trading algorithms, those that are used for optimal execution, i.e. obtaining the best possible price for an order, and those used for speculation. This paper describes both from a theoretical perspective, and shows how two types of speculative algorithms can be designed. The first is a strategy that uses exponential moving averages to capture price momentum. The second is a market neutral relative‐value strategy that trades individual stocks against each other known as pairs trading. Both are tested using empirical data and the results are encouraging. Despite the widespread use of algorithms in the markets, evidence remains of positive excess returns. In particular, the results of Gatev et al (2006) based on pairs trading are confirmed using more recent data from the London Stock Exchange. The idea of univariate pairs trading is extended to a multivariate framework in two ways. The second is based on state space methods. The results show that for the data sample used, higher transaction costs outweigh any benefits from this extension. The theoretical foundation of trading algorithms is market microstructure theory. This theory deals with the dynamics of trading and the interaction that takes place between market participants. Among the important issues are the existence of asymmetric information and the adjustment of market prices to new information, either private or public. The methodology of Hasbrouck (1991) is used to analyze the information content of high‐frequency transaction data, also from the London Page | 2 AEF Thesis Stock Exchange. The results obtained show that the main conclusions in Hasbrouck’s paper remain valid. The concept of optimal execution is given a theoretical treatment based on Almgren and Chriss (2001) and McCulloch (2007). The first paper shows that the problem of minimizing implementation shortfall can be expressed as a quadratic optimization problem using a simple utility function. The second paper shows how the intra‐day volume‐weighted average price can be used as a benchmark for optimal execution. AEF Thesis Page | 3 2 CONTENTS 1 Summary ............................................................................................................................................ 2 3 Introduction ....................................................................................................................................... 6 3.1 Overview .................................................................................................................................... 6 3.2 Literature .................................................................................................................................... 7 3.3 Notation ..................................................................................................................................... 8 4 Background Part I: Market microstructure theory ............................................................................ 9 4.1 Introduction and overview ......................................................................................................... 9 4.2 Liquidity pools and aggregators ............................................................................................... 10 4.3 The information content of stock trades ................................................................................. 10 4.3.1 Bins and transaction time ................................................................................................. 11 4.3.2 Model specification ........................................................................................................... 12 4.3.3 Vector autoregression ...................................................................................................... 13 4.3.4 A simple microstructure model ........................................................................................ 16 5 Background Part II: Trading algorithms ........................................................................................... 17 5.1 Overview .................................................................................................................................. 17 5.2 Optimal execution algorithms .................................................................................................. 19 5.2.1 Optimal execution with a quadratic utility function ......................................................... 20 5.2.2 Extensions to the optimal execution model: Drift ............................................................ 25 5.2.3 Extensions to the optimal execution model: Serial correlation ....................................... 26 5.2.4 Sub‐conclusion .................................................................................................................. 26 5.2.5 Optimal VWAP Trading ..................................................................................................... 27 5.3 Speculative algorithms ............................................................................................................. 30 5.3.1 Overview ........................................................................................................................... 30 5.3.2 Pairs trading ...................................................................................................................... 32 5.3.3 Cointegration .................................................................................................................... 33 5.3.4 Pair selection and trading signals ..................................................................................... 35 5.3.5 Multivariate pairs trading ................................................................................................. 36 6 Background Part III: State space models ......................................................................................... 39 6.1 Introduction .............................................................................................................................. 39 6.2 The linear Gaussian state space model .................................................................................... 39 6.3 An example of a structural model ............................................................................................ 41 Page | 4 AEF Thesis 6.4 The Kalman filter ...................................................................................................................... 42 6.4.1 The Kalman smoother and Disturbance smoothing ......................................................... 44 6.4.2 Maximum likelihood estimation ....................................................................................... 45 6.4.3 Standard error of maximum likelihood estimates ............................................................ 47 6.4.4 The expectation maximization algorithm ......................................................................... 47 7 Analysis Part I: High‐frequency equity data .................................................................................... 49 7.1 Data description ....................................................................................................................... 49 7.1.1 Description of a representative stock: Anglo American PLC ............................................ 49 7.2 Dealing with transaction time .................................................................................................. 51 7.3 Empirical analysis of tick data .................................................................................................. 53 8 Analysis Part II: Speculative algorithms ........................................................................................... 58 8.1 Momentum strategies using moving averages ........................................................................ 58 8.1.1 EMA‐momentum strategy with different sampling frequencies...................................... 63 8.2 Univariate pairs trading ............................................................................................................ 66 8.3 Multivariate pairs trading ......................................................................................................... 77 9 Conclusion ......................................................................................................................................