Docsity

high frequency trading, Lecture notes of Applications of Computer Sciences

Toggle sidebar
bg1
Developing
High-Frequency
Equities
Trading
Models
By
Leandro
Rafael
Infantino
B.Sc. Industrial Engineering
Instituto
Technologico
De
Buenos
Aires
(ITBA),
2004
By
Savion
Itzhaki
B.Sc. Electrical
Engineering /B.A.
Physics
Technion
-
Israel
Institute
of
Technology, 2006
SUBMITTED
TO THE
MIT
SLOAN
SCHOOL
OF
MANAGEMENT
IN
PARTIAL
FULFILLMENT
OF
THE
REQUIREMENTS
FOR
THE
DEGREE
OF
MASTER
OF BUSINESS
ADMINISTRATION
MASSACH
AT
THE OF1
MASSACHUSETTS
INSTITUTE
OF TECHNOLOGY
June,
2010
LIE
©2010
Leandro R. Infantino
and Savion
Itzhaki.
All
rights
reserved.
ARCHIVES
USETTS
INSITuTE
ECHNOLOGY
N 0 8
2010
RARIES
The
author
hereby
grants
to
MIT
permission
to
reproduce
and
to
distribute
publicly
paper
and
electronic
copies
of
this
thesis
document
in
whole
or in
part
in
any
medium
now
known
or
.,
ereafter created.
Signature
of
Author:
,r)
/7,/
Signature
of
Author:
Leandro
R.
Infantino
MIT
Sloan
School
of
Management
May
7,
2010
Savion
Itzhaki
MIT Sloan
School
of
Management
May
7,
2010
Certified
by:
Roy
E.
Welsch
Professor
of
Statistics
and Management
Science and
Engineering
Systems
Thesis
Advisor
Accepted
by:
Debbie Berechman
Executive
Director,
MBA Program
MIT Sloan
School
of
Management
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b

Partial preview of the text

Download high frequency trading and more Lecture notes Applications of Computer Sciences in PDF only on Docsity!

Developing High-Frequency Equities Trading Models

By Leandro Rafael Infantino B.Sc. Industrial Engineering Instituto Technologico^ De^ Buenos^ Aires (ITBA), 2004

By Savion Itzhaki B.Sc. Electrical Engineering /B.A. Physics Technion - Israel Institute of Technology, 2006

SUBMITTED TO THE MIT SLOAN SCHOOL OF MANAGEMENT IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF

MASTER OF BUSINESS (^) ADMINISTRATION MASSACH AT THE OF MASSACHUSETTS INSTITUTE OF TECHNOLOGY

June, 2010

LIE

©2010 Leandro R. Infantino and Savion Itzhaki. All rights reserved.

ARCHIVES

USETTS INSITuTE ECHNOLOGY

N 0 8 2010

RARIES

The author hereby grants to MIT permission to reproduce and to distribute publicly paper and electronic copies of this thesis document in whole or in part in any medium now^ known^ or

. ,^ ereafter

created.

Signature of Author:

,r) /7,/ Signature of Author:

Leandro R. Infantino MIT Sloan School of Management May 7, 2010

Savion Itzhaki MIT Sloan School of Management May 7, 2010

Certified by: Roy E. Welsch Professor of Statistics and Management Science and Engineering Systems Thesis Advisor Accepted by:

Debbie Berechman

Executive Director, MBA Program MIT Sloan School of Management

Acknowledgments

We would like to thank all of those who helped throughout the thesis write-up. We would like to start by thanking Prof. Roy E. Welsch^ for^ being^ our^ advisor^ in^ this^ thesis,^ for^ all^ of^ his^ guidance and support,^ and^ for^ presenting^ us^ with^ this^ unique opportunity^ to^ work^ with^ him. We also thank Prof. Jun Pan, Prof. Leonid Kogan, and Mark T. Mueller of MIT for helpful comments and^ discussion^ throughout^ the^ process. Finally, our special thanks goes to Neil Yelsey from QCap LLC. This thesis would not have been possible^ without^ the Neil^ great^ devotion^ to^ this^ process.^ Neil^ has shared^ with^ us^ a^ great amount of time and^ resources^ for^ this^ thesis^ and^ has^ been^ a^ real^ mentor.

Contents

  • 1 INTRODUCTION - 1.1 DESCRIPTION OF THE PROBLEM - 1.2 AVAILABLE SOLUTIONS.. .ARE THERE ANY?
  • 2 THE M ODEL - 2.1 THE BENEFITS OF USING LOG RETURNS - 2.2 THE USE OF PRINCIPAL COMPONENT ANALYSIS - 2.3 THE USE OF CUMULATIVE RETURNS - 2.4 DESCRIPTION OF THE MODEL - 2.5 SIMPLIFYING ASSUMPTIONS......................................................................................................... - 2.6 BASIC MODEL RESULTS................................................................................................................
  • 3 REGIM E SW ITCHING M ODEL - 3.1 DESCRIPTION OF THE MODEL - 3.2 REGIME SWITCHING MODEL RESULTS...........................................................................................
    • 4 POTENTIAL IM PROVEM ENTS..............................................................................
      • 4 .1 C LU STERIN G
      • 4.2 SELECTION OF EIGENVECTORS........................................................................................................
      • 4 .3 N L S
      • 4 .4 O TH ER
  • 5 CONCLUSION
    • REFERENCES

(^1) Introduction

1.1 Description of the problem

The problem we want to solve is a long lived dilemma that traders, asset managers, insurance companies, banks, private investors and even any human being would be more than happy to solve, because a deterministic closed form type of solution would simply mean infinite wealth to whomever discovers it. The problem we want to solve is twofold: (i) A short term security valuation problem. (ii) A regime identification problem, to understand if the market will act either in line, or opposite of our valuation. In particular, we want to build a predictive model to estimate future returns on US equities on a high frequency environment, with approximate holding periods on the order of seconds to minutes, to exploit a quantitative signal driven trading strategy. We are more than aware of the challenge we face, and before trying to describe how we plan to address it, we want to ensure we completely understand what type of problem and challenge we are dealing with. We firmly believe that the recent paper written by Mark Mueller and Andrew Lo

("WARNING: Physics Envy May Be Hazardous To^ Your^ Wealth!"^ -^ March 2010) describes very clearly the dilemma on how to understand the spectrum of challenges (^) involved in solving problems in finance and economics. They demonstrate that the systematic quantitative approach (typical of hard core sciences such as physics) used to solve finance and economics problems over time have led to significant advances. However, completely relying on it can lead to dangerous pitfalls. They defined taxonomy of uncertainty in to 6 levels of risk: (i) "Level 1: Complete Certainty" ...^ "All^ past^ and future states^ of^ the^ system^ are^ determined exactly if initial conditions are fixed and known-nothing is uncertain." (ii) "Level 2: Risk without Uncertainty" ... "No statistical inference is needed, because we know the relevant probability distributions exactly, and while we do not know the outcome of any given wager, we know all the rules and the odds, and no other information relevant to the outcome is hidden." (iii)"Level 3: Fully Reducible Uncertainty" ... "situations in which randomness can be rendered arbitrarily close to Level-2 uncertainty with sufficiently large amounts of data using the tools of statistical analysis."

Information Ratio (IR) (^) 1 on a trading strategy, is approximately proportional to (^) the Information Coefficient (IC) and (^) to the Breadth by the following (^) relationship:

IR = IC VBreadth

where the IC is defined as (^) the coefficient expressing (^) our skill, or the quality of (^) our investment decisions, and the "breadth" (^) is the number of independent (^) decisions made on (^) a trading strategy in one year, or also defined (^) as "the number of independent (^) forecasts of exceptional (^) return we make per year". (^) The IC should be computed (^) as the correlation (^) between the forecasts and (^) the actual outcomes, (^) by definition. Let's build a (^) numerical example to identify (^) the advantage of operating (^) in the high frequency environment. (^) Let's assume that a certain "star" portfolio manager (^) manages a portfolio of the (^) 500 stocks on the S&P (^) 500. This seems like (^) a reasonable number in (^) order to be able to follow responsibly (^) all the fundamentals driving (^) the prices of all the stocks, with the assistance of (^) his group of analysts, (^) along the time. Let's also (^) assume that based on his (^) analyses he makes around 350 independent (^) decisions every year on (^) his portfolio. This means (^) that he trades 350 times in (^) his portfolio over (^) a year, representing (^) a bit more than (^) one trade per day, either for rebalancing, buying, selling or shorting (^) his stocks. For somebody aiming at a holding (^) period of 2 to 5 years per stock, this number (^) of stocks and the number (^) of independent decisions (^) seem reasonable. Translating this into Grinold's and Kahn's (^) concept, this portfolio (^) manager's strategy has a Breadth of 350. Assuming (^) he has an IC = 0.05 (which (^) represents a very high skill and quality of investment decisions), we (^) expect him to obtain (^) an Information Ratio of (^) 0.93. This is a huge Information Ratio, representative of a traditional low frequency portfolio manager (^) who has such an impressive (^) IC as this one; remember (^) this is the "star" portfolio (^) manager. Now imagine (^) a simple high frequency (^) trader, who works by himself (^) and designs a quantitative (^) trading strategy on 3000 of the most (^) liquid stocks in the US market. (^) His strategy, just like ours, (^) updates a trading signal (^) every second on the (^) 3000 stocks. There are (^) 23,401 seconds in a trading (^) day, and 5,873,651 on a year. Assuming (^) the trading strategy has (^) average holding periods (^) of 100 seconds per (^) stock, each stock trades (^) around 234 times per day. (^) Considering the (^3000) universe of stocks and 251 trading (^) days per year, the Breadth (^) is equal to 176,202,000. To (^) achieve an Information

IR is defined (^) as the ratio of residual return (^) to residual risk. The residual (^) return is the excess returns (^) over a benchmark (e.g. (^) S&P 500 index), and the residual (^) risk is the standard deviation of (^) that excess return. It's a similar concept to the Sharpe Ratio (^) (where the benchmark is the risk (^) free rate), but from a strict asset (^) management perspective (^) where it is more common to analyze (^) everything from a "benchmark" (^) perspective.

Ratio similar to the "star" portfolio (^) manager, this single-member team high frequency trader, only needs to achieve an IC lower than 0.00008, which means he can be 13,000 times^ less precise in his estimations than his low frequency peer! This is impressive! This reality has encouraged us to try to attack the problem we have been discussing, given that the high frequency environment allows us to be much less precise and still generate very attractive excess returns. We totally agree and understand the magnitude of the challenges that Mueller and Lo presented in their paper, so we tried to play in a world where the lack of possibilities to build precise quantitative models was not a restriction to generate decent alpha; we wanted to play in a world where "Physics Envy" was not so "Hazardous to our Wealth". One important feature of the problem we want to solve is to try to predict opportunities that arise from dislocations of a stock from its fair value, and trade on the expectation that it will mean-revert 2. Knowing that most of the high frequency traders operate on the range of the milliseconds and mainly try to predict movements in prices on liquid stocks just to be able to place the right bids and asks and get rewarded with exchange rebates and bid ask spreads, we can only assume that they are not very much focused on predicting a fair value of^ the^ stocks they^ are trading, but rather try to earn profits by providing liquidity 3. This fact motivates^ us^ to^ think^ that if any mispricing arises in the high frequency environment, the "ultra high^ frequency"^4 traders are probably not going to arbitrage it away, given their holding periods are shorter, and given that it is not in their interest to obtain profits by valuation. Let's^ now^ consider^ the^ effect identified by the working paper done by^ Jakub Jurek^ and^ Halla^ Yang^ on^ Dynamic^ Portfolio Selection on Arbitrage based on studying the^ mean^ reverting arbitrage^ opportunities^ on equity pairs. They show^ how^ divergences^ after^ a^ certain^ threshold^ of^ mispricings^ do^ not^ precipitate further allocations to arbitrage strategies, but rather reduce the allocation on these arbitrage opportunities due to intertemporal hedging demands. This tells us in some way that when 2 We only expect this mean-reversion under conditions where (^) momentum signal is not strong (^) enough to cancel the strength of this mispricing. We address in section 3.1 how we take into consideration a regime shift in the environment that we are analyzing as an aggregate, which in return affects the significance or validity of the mean reversion signal we^ observe and^ base^ our^ trades^ on. 3 A big issue that arises when observing the high frequency trading world is that the information that (^) is available in the exchanges regarding liquidity and depth of book are highly disturbing. Many quotes may have hidden volumes in their bid/ask quotes. So for instance,^ if^ an^ investor looks^ to^ by^ stock^ A^ and^ sees^ an^ ask^ price^ of $10 for the amount of 100 shares, it could most possibly be that there is a much larger quantity hiding behind this quote of 10000 shares or even more. Not only can a trader hide his^ volume^ of^ the^ trade^ but^ also^ hide the^ quote^ all together. This means that the information available is at times misleading and therefore high frequency traders tend to test the market and "game" other traders in order to get a better picture of the real information, and make their profits based on their ability^ to^ interpret^ this^ information.^ One^ may^ say^ it^ almost^ as^ if^ they^ are^ playing^ poker. 4 These are traders that have latencies below one millisecond from the moment they receive a signal from the market till the time they execute the trade. This arena is mostly driven by technology.

to predictive problems in the high frequency environment^5 : 35% average annual returns^ since

1982. These numbers are after fees, and in particular, Renaissance^ charges^ management^ fees^ of 5% and a profit participation of 36%, while all hedge funds operate on^ the 2%-20%^ fee^ structure. There is no other fund in the history of financial markets^ that^ has^ achieved similar results.^ What would we give for Mr. James Simons (Renaissance founder) to^ publish^ a^ paper^ with^ at^ least^ a few of his trading strategies? However, this hasn't happened yet, and^ we^ predict^ with^ very^ high confidence it will not happen any time soon. Discouraged by the proprietary^ nature^ of^ high frequency^ trading^ strategies,^ we^ explored other universes of lower frequencies, where we could find potentially applicable solutions or concepts, that could eventually be^ translated^ to^ our universe^ of^ interest. The first most basic and very illustrative example we want to use,^ is^ that^ used^ by^ the^ paper published by^ Khandani^ and^ Lo^ in^^2007 -^ "What^ happened^ to^ the^ quants?"^ -^ to^ analyze^ the^ quant melt down of August 2007. In an attempt to explain what nobody^ could,^ which^ was^ to^ identify what caused^ the^ sudden^ shock^ and the^ three-day simultaneous^ melt^ down^ of^ all^ the^ quantitative driven quant shops in Wall Street, Khandani and^ Lo^ built^ a^ basic^ market^ neutral^ equity trading strategy, based on the most basic concept of^ statistical^ arbitrage.^ The strategy^ consists^ of^ "an equal dollar amount of long and short positions,^ where^ at^ each^ rebalancing^ interval,^ the^ long positions consist of "losers" (underperforming^ stocks, relative^ to^ some^ market^ average) and^ the short positions consist of "winners" (outperforming stocks, relative to the same market average). Specifically, if wit is the portfolio weight of security (i) at date (t), then"

N 11 Wit = N (Rit-k - Rmt-k) Rmt-k = 1- Rit-k

Note that this strategy positions a weight in each stock proportional^ to^ the^ dislocation^ of^ its return to the market threshold, and^ that^ the^ aggregated^ stock weight^ adds to^ zero^ (here the^ name of market neutral). This simple trading^ strategy^ implemented^ with^ k=1^ day (which^ means^ that^ the signal and rebalancing^ occurs^ every day, and also^ the^ "winners"^ vs.^ "losers"^ are^ evaluated^ daily) delivers average Sharpe Ratios considering a null risk^ free^ rate^ (which^ in^ these^ days^ is^ nothing too unrealistic) and avoiding transaction costs, starting at 53.87 in^^1995 and^ ending^ in^ 2.79^ in

5 The Medallion Fund's performance given here is not attributed^ solely^ to^ the^ high frequency^ strategies^ it uses

but also to other strategies and in^ other products^ as^ well.^ However,^ these^ numbers^ just^ come^ to^ illustrate^ why^ there^ is a strong motive in this^ industry^ not to^ share^ information^ on^ trading strategies.

2007. Although some of the stocks tested in this paper are those with highest illiquidity and coincidentally where the greatest Sharpe Ratios come from, and therefore bias the returns to an exaggerated upside, there are still very encouraging figures to believe on the power of statistical arbitrage and mean-reversion trading strategies. Moreover, on the same paper, Khandani and Lo show how simulated similar strategies on higher trading frequencies from 60 minutes to 5 minutes increase the cumulative returns in less than three months to 110% and 430% approximately. What we conclude from this paper is that convergence of returns to a fair measure seems plausible and adequate, and even more as the trading frequency increases. One very important assumption of this basic strategy that we will certainly avoid when constructing our solution7 is that it assumes that every security has a CAPM Beta close to one, or a covariance similar to the covariance of the wide market with itself. This is not mentioned nor intended, but it's a natural consequence of such a strategy given it expects mean reversion to a market threshold estimated without considering any kind of significant covariance differences, which we know exist. Let's assume the following situation to illustrate our observation. Two of the stocks in the market are an oil producer and an airline. Let's also assume that these two (^) stocks are inversely correlated, which is intuitively reasonable given the opposite exposure of both companies to the price of crude oil. Let's assume the price of oil goes up, and the broad market of equities has excellent positive returns too, in one day. If the broad market had a remarkable positive shock (more than that of crude oil) due to some macroeconomic positive announcement, we expect the oil company to rise in price more than the airline, given that the latter is negatively affected by the oil price shock, while the previous benefitted. (^) In other words, we know that the covariance of these stocks and the market are different, and therefore they have different CAPM Betas. Nevertheless, given the broad market average return threshold increased less than the oil company's and more than the airline's, the model will send us a signal to "long" the airline and "short" (^) the oil company, ignoring completely that these Betas might not be close to (^) one; and missing the fact that given they are significantly different due to their inverse-correlation- one at least has to be substantially (^) different to one. We say the model ignores this because if the oil

6 Another important reference (^) that also contributes to our motivation to explore (^) mean reversion, as (^) a previous cornerstone of this paper, is the paper written (^) by Lo and MacKinley in 1990 where they show how the mean- reversion paradigm is typically associated with market over reaction and may be exploited (^) to generate alpha. 7 This strategy has obviously been shown by Khandani and (^) Lo only for illustrative purposes but we plan to take from it the valuable concepts and address those assumptions that can potentially affect results significantly on a real trading environment.

As we can see we can pretty much be identified by their definition (^) as stat arb players, but the main difference we are going to have, is that we will not (^) restrict ourselves to be market neutral, and we will allow the strategy to take directional market risk. The strategy, or "ancient" solution to the problem they wanted to address, was a simple "pairs" type of trading strategy^9 based on the expectation that one (^) stock would track the other, after controlling (^) adequately for Beta in the following relationship, for stocks P and Q:

In (Pt/Pto) = a(t - t (^) o ) + # In (Qt/Qto) + Xt

In its differential version:

dPf (^) dPQt =cadt +fl (^) + (^) X Pt Qt

where Xt is a mean reverting process. Avellaneda and Lee (2010) took this concept and built a model where the analysis of residuals generated signals that were based on relative value pricing of a sector (or cluster, (^) as we like to call it). They decomposed stock returns to systematic (^) and idiosyncratic components by using PCA and statistically modeled the idiosyncratic component. Their general decomposition looks like this:

d~t n =P adt + Z;flhFf + dXt Ptj=

where FU represents the risk factors (^) of the market/cluster under consideration. The concept of this solution is pretty similar to an important issue that we want to address (explore mean reverting nature by using PCA) and we will definitely build our ideas of mean reversion based on a similar behavior. Our framing of the problem will be slightly different, given we instead want to focus on the systematic components of risk obtained from the PCA and use them as predictive factors of future returns, by (^) fitting an OLS model. Therefore, establishing

9 Trade expecting the convergence of a pair of stock returns on the (^) same industry or with similar characteristics

mean reverting thresholds will be achieved by a different model.^ But^ the^ very^ basic^ ideas^ are consequences of this "ancestor" trade^ as^ described^ by^ Avellaneda^ and^ Lee^ in^ their^ paper.

Then, the log return^ is^ defined^ as:

log (1 + r,) = log (^) (Po - = log(P 1 ) - log(Po)

Using log returns we can easily compound the returns over n periods as follows:

log(1+r 1 )+ log(1+r 2 )+ -+ log(1+rn) = log + log P 2 + -+ log )= LP0 P1 Pin_1) log(P 1 ) - log(Po) +^ log(P 2 )^ -^ lo9P^1 )^ + -+^ log(Pn)^ -^ log(Pn- 1 )^ = log(Pn) - log(PO)

Thus, compounding returns is as easy as summing up two numbers. The second reason why we used log-returns was because normality holds when compounding returns over a larger period. For example, if we assume that r, is normally distributed, than (1 + ri) is also normal because normality is preserved under addition. For the same reason (1 + r 2 ) is normal. However, (1 + r 1 )(1^ +^ r^2 )^ is^ not^ normal^ anymore^ since^ normality^ is^ not preserved under multiplication. On the other hand, assuming log(1 + ri) is normal,^ than^ log(1^ +^ r^2 )^ is^ also^ normal.^ For^ n period returns we can say that the total^ return^ is^ a^ linear^ combination^ of^ normally distributed variables, and thus it is^ also^ normally^ distributed. Another reason for the^ use^ of^ log-returns^ is^ that^ prices^ are^ log^ normally^ distributed.^ So, if log (1 + r 1 ) is a random^ variable^ with^ a^ normal^ distribution,^ then

P 1 log(Pi) PO

has a log-normal distribution. This is intuitive since prices are non-negative and can rise to infinity, just as the^ log^ normal^ distribution^ is^ skewed^ to^ the^ right.^ Quoting^ the^ book "Econometrics of Financial Markets' by Campbell, Lo and MacKinlay: " [...] problem that afflicts normally distributed returns: violation of limited liability. If the conditional distribution of Pt is normal, then there will always be a positive probability that Pt < 0.". This problem is solved when taking log returns.

Finally, log returns are similar to real returns. In the high frequency (^) space where we look at one-second returns, the returns are fairly small and in (^) approximation the log returns equal to the real returns. log (1 + r) - r , r 1

2.2 The Use of Principal Component Analysis

Principal Component Analysis is a tool of multivariate statistics widely used in engineering and sciences to explain the main components of the variance of the many datasets involved in the problems scientists (^) and engineers aim to solve. PCA helps identify the drivers of variance in chromatography analysis, image processing, medical diagnosis, soil biology, etc. The good news is that (^) PCA has also been widely used in finance to (^) explain the risk drivers of diverse assets, given that one of the major variables used to explain the risk in financial assets is the variance of their time series of returns. For example, the paper on "Statistical Arbitrage (^) in the US Equities Market" mentioned before (Avellaneda-Lee 2009) shows how one of the factors determining the trading signals of their model is obtained through a PCA on stock returns. The paper shows how PCA can play a major role in modeling risk in Finance and be used to build an alpha model. It is over this concept - that the principal components represent an important role in determining intrinsic risk and therefore value of securities - that we want to build on. Instead of measuring the residual component of the stock returns, we use the principal component for valuation using a simple linear predictive model we will describe in section 2.4. Although our predictive method is different, and our time frames and (^) holding periods shorter, we still believe on the power that PCA has to explain intrinsic and fair (^) value of financial assets, and this concept around PCA where Avellaneda and Lee build on part of their paper, is the cornerstone and motivation behind our trading model in the high frequency environment. Another advantage of PCA (^) in the time environment we are dealing with, is that traditional fundamental factors used (^) to determine valuation of securities for larger holding periods (months and years) play a minor role in the valuations we are doing, and therefore, we really don't care about the "identity" of the components of risk; we just want to capture them and ensure we capture the relevant ones. For example, the Debt to Equity ratio, the Current Ratio, and Interest Coverage of a company most of the time play a minor role in the price at which a certain security will trade in the next 30 seconds. There are rather other factors affecting the high frequency trading environment. For example, the computer driven algorithms implemented by high frequency hedge funds, by broker dealers to execute their trades efficiently, or by asset managers