Course Description
Systematic Quant funds are a rapidly rising part of the hedge fund and smart beta world. Although there is a large focus on high-frequency by academics, medium-to-low frequency algo trading accounts for over $350bn AUM and is the highest growth segment of the HF world.
This algorithmic trading course covers the underlying principles behind algorithmic trading, including analyses of trend-following, carry, value, mean-reversion, and relative value strategies. We will discuss the rationale for the strategy, standard strategy designs, the pros and cons of various design choices, and the gains from diversification in portfolio strategies. Finally, since the industry is plagued by overfitting and resulting poor performance, we will discuss p-hacking (or 'financial charlatanism') and various strategies to avoid it.
What am I going to get from this course?
Professionals - Understand the mechanics of standard implementations of the single asset and portfolio based risk-premia trading strategies. Recognize pros and cons of various approaches to designing strategies and the common pitfalls encountered by algorithmic traders. Be able to devise new and improved algorithmic
Algorithmic Traders - Recognize the reasons commonly-used strategies work and when they don't. Understand the statistical properties of strategies and discern the mathematically proven from the empirical. Acquire an understanding of methods to prevent overfitting.
Academics/students - Gain familiarity with the broad area of algorithmic trading strategies. Master the underlying theory and mechanics behind the most common strategies. Acquire the understanding of principals and context necessary for new academic research into the large number of open questions in the area.
Prerequisites and Target Audience
What will students need to know or do before starting this course?
Course work to include (or familiarity with the following topics):
- Undergrad ODE and PDE (math physics or engineering/Fourier expansion based)
- Some Stochastic Differential Equations (SDEs), although some will be covered in the course
- Basic undergrad Analysis
- Optimization
- Numerical linear algebra.
- Statistics (taught in a statistics, econometrics, machine learning or signal processing course)
- Familiarity with some time-series and difference equations
- Coding
- Python or Matlab or R
- OOP
- Finance: Familiarity with financial products: Futures, Equities, Bonds, Commodities
- Helpful but not necessary: Black-Scholes Option Pricing
Who should take this course? Who should not?
Educational Background
Bachelors or Masters degree
- in Physical Sciences and Engineering
- in Computer Science with a firm understanding of mathematics
- in Economics or Finance with a firm knowledge of econometrics
Curriculum
Module 1: Course Overview
28:14
We discuss algo trading strategies and their recent context in the world of alternative investment management
Lecture 2
Context and Background
09:10
Introduction to the area, Algo as opposed to High-Frequency/Low Latency Trading, and areas of growth.
The goals of the course, for students/academics, professionals, and algo traders, and general background to the course.
Lecture 3
What the course is Not and the Role of Data Science
06:18
What the course is not.
The Role of Data science and ML - do data scientists need to know about 'canonical' strategies? Can they just start fresh? We argue that some of the most commonly used strategies give good guidance for data scientists whose techniques rarely work "out of the box" and are especially prone to problems in the area of algo trading strategies.
Lecture 4
Prerequisites and Syllabus
03:34
We describe the basics of the syllabus. Some of these materials are covered very thoroughly, while others are covered quite quickly as methods in use / approaches to consider in devising and refining strategies. We cover Background, Momentum, Mean Reversion, Carry, Value, Basic Portfolio Strategies, and the important concept of Overfitting, focusing on the mathematical and statistical justification, formulation and properties of each strategy.
Resource 1
Slides on Introduction, Background Material, Goals and Prerequisites and Syllabus
Module 2: Industry Overview and Math Review
56:52
Lecture 6
Industry Overview
05:10
Alternatives, Hedge Funds, CTAs and Quant Funds. What size and what numbers? How much are they growing? Where are the opportunities? From the top down look at the overall prospects of the industry where Algo Trading Strategies are employed.
Lecture 7
Tracking Funds
05:42
Lecture 8
Tracking Benchmarks
04:36
Lecture 10
Algo Trading Strategy Infrastructure
04:38
Quiz 1
Intro Quiz on Background
Quiz on background and introduction
Lecture 11
Review 2 ARMA Processes
09:46
We review basic Box-Jenkins method for ARMA models, look at characteristic polynomials, describe stationary vs nonstationary processes
Lecture 12
Review 1 - White noise and Brownian motion
07:12
We review some of the basic mathematics for timeseries including white noise and brownian motion
Lecture 13
Review 3 - Autocovariance, autocorrelation and criteria
05:00
We review the ACF and its relation to ARMA models, and start on criteria (AIC, BIC) as a means of doing model choice.
Lecture 14
Review 4 - Cross Validation, Bootstrap and solving SDEs
10:09
We touch on more computer intensive methods for doing model selection - cross validation, and finding standard errors-bootstrap. Finally, we discuss two most common method for solving SDEs in closed-form, muitipying constants and integration by parts/Ito's lemma
We go through some basic ARMA models and their ACFs
Module 3: Momentum / Trend Following
01:16:53
Lecture 15
Momentum - a first glance
04:26
We introduce the very basic intution behind momentum and how we would construct the most simplistic of strategies
Lecture 16
Momentum Related Factoids 1
06:16
We discuss some of the properties and tradeoffs of momentum, many of which can be changed by strategy design.
Lecture 17
Momentum Factoids 2
05:01
Further factoids including examples of returns in practice
Lecture 18
Proving results about momentum 1
07:02
We look at discrete time versions of momentum and seek to prove that skewness changes by horizon
Lecture 19
Proving results about momentum 2
10:08
This is a whiteboard section on the basics of the skewness over horizon results (Martin-Zou), going through the proof, showing that the concepts are relatively easy (even if the algebra is a little tedious).
Lecture 20
Skewness - why is it so strange?
03:58
Having proved results about the skewness of momentum returns over different horizons, we apply it to an exponentially weighted moving average (EWMA) rule, showing how the peak skewness is related to the effective lookback (in our case, the "span") of the EWMA.
Lecture 21
Practical Momentum - Different methods for similar results
07:21
We describe the most commonly used methods in the industry, from Kalman Filters to Moving Averages to ARIMA models. Used properly, most of these models can attain almost the same performance.
Lecture 22
Coding Momentum 1
10:46
We introduce an ipython notebook. It takes data from Quandl (and some from Yahoo finance) including SPX, SPTR, and Effective Fed Funds. We use these to construct S&P 500 excess returns, and compare to SPX. We then devise a strategy for momentum.
Lecture 23
Coding Momentum 2
05:38
Computing relevant stats (Sharpes and Skewness) over different horizons
Lecture 24
Momentum variants, and fads and fancies in models
05:10
Cross sectional vs Timeseries momentum. Which is better? Where are each of them used? Why should we know them both?
Fads and fancies in momentum modelling. Models vs Method.
Lecture 25
Momentum - capped, floored and otherwise altered signals
03:45
We look at Winsorising or capping and flooring the signals (sometimes needed to prevent too large capacity utilisation), using thresholds, etc. These typically detract from the skewness, but they could help the overall performance. We look at various methods and discuss their pros and cons and how to measure them.
Lecture 26
Readings for further study
04:20
We give links to and summarize the handful of most important papers on statistical aspects of momentum trading for further study. Being well-known, these are also the most cited papers, and so any new academic research can be found (using google scholar) just by searching preprints and papers which cite these important studies.
Lecture 27
Momentum - Summary
03:02
Summarizing the main points we made in section 2 on Momentum
Module 4: Mean Reversion / Change-points
01:46:02
Lecture 28
Mean Reversion Overview and Time-scales of trades
08:03
Overview of MR, and the timescales/horizons associated with MR, Momentum and Value
Lecture 29
Putting timescales all together and where to search for history
06:41
A continuation of the previous lecture, putting the timescales all together, and looking to ancient history (if need be)
Lecture 30
Mean Reversion in action
04:28
The typical features of an MR trading strategy, what to expect and what to be careful with
Lecture 31
Rationales for Mean Reversion
06:56
Various competing (or not so competing) rationales for mean reversion: Liquidity Provision and Overreaction
Lecture 32
Vol and Mean Reversion
07:46
Volatility and Mean Reversion, the theory and empirics behind their relationship
Lecture 33
Liquidity - References
03:05
A few of the most important academic papers on liquidity
Lecture 34
Mean Reversion and Unit Root Tests, Intro
04:51
An analysis of the types of behaviour we want to discern between, focusing on mean reverting vs unit root processes.
Lecture 35
Augmented Dickey Fuller Tests
05:19
ADF Tests are the most commonly used unit root tests out there. We introduce their use and limitations
Lecture 36
KPSS Tests
03:45
KPSS tests turn H0 and H1 on their heads, testing for mean-reversion. They also have their limitations
Lecture 37
Variance Ratio Tests
04:08
We introduce variance ratio tests, explore their use and misuses
Lecture 38
Cointegration and Johansen Test
09:35
Cointegration and Engle Granger testing, and the more thorough Johansen test
Lecture 39
Harvey Nyblom Tests and Shortcomings
04:27
Harvey Nyblom is to Johansen as KPSS is to ADF and we explore H-N Tests and then the shortcomings for all testing methods
Lecture 40
Power, Type I and Type II errors
04:16
power of tests, confidence intervals, type 1 and type 2 errors
Lecture 41
RV Trades
04:47
Lecture 43
Changepoints - Overview
08:57
Overview and more classical approaches to changepoint detection. These are useful for piecewise linear fits to data to establish trending means and mean reversion to these trending means.
Lecture 44
Changepoints - Lasso based tools
06:17
Using the lasso regression to detect trends, we can identify breakpoints and extract trends at the same time. While not always the easiest method, regularisation methods like lasso are helpful in many circumstances and also are a decent framework to think of the underlying problems.
Lecture 45
Changepoints - sequential binary segmentation, switching kalman filters and summary
05:17
We follow up with a very practical and implementable tool - sequential binary segmentation (and Wild binary segmentation)
Module 5: Carry, Value, and Portfolio Strategies
54:24
Lecture 46
Carry - First definitions
06:05
We define carry and give a rationale in terms of P vs Q measures
Lecture 47
P vs Q measure
04:23
We continue the discussion of the differences between P measure (physical world) vs Q measure (for pricing and hedging derivatives). While Q (where spot rates will always drift towards forwards or - 'forwards are realised') is an interesting construct, it is merely that. We have to use it to price and hedge (or 'risk manage') derivatives. Realistically, in incomplete markets, Q is not actually unique and is merely a useful construct. Realistically speaking, spot rates tend to stay put, and random walks are much more likely than having realised forwards. If spot rates are martingales/random walks, this is a perfectly decent rationale for studying carry.
Lecture 48
Defining Carry
03:52
Defining carry-- what is it? Why do we care about it? What is a positive carry position and what is a negative carry position? What about commodities?
Lecture 49
Carry for Swaps (and a little for bonds)
05:03
We define carry for swaps, something not as easily available, and also a little bit for bonds. Bonds, however, are altogether more difficult, since you need to know bond-specific funding rates (term repo rates), so we mostly pursue carry for swaps.
Lecture 50
Carry for Futures, FX, Equities and Derivatives
06:50
We briefly describe carry for Futures (including commodity and equity) and FX and for the less well covered area of Derivatives.
Lecture 51
Carry - Summary
03:31
We summarize the exploration of carry
We define value, its use and how it differs from Equities (where it is well defined and followed regularly) to fixed income, fx and commodities. Value, with its longer-term mean-reversion properties, is naturally orthogonal to momentum, and mean-reversion.
Lecture 53
Portfolio Strategies 1 - MVO
06:43
Mean variance optimisation as a guide to basics of portfolio strategy
Lecture 54
Portfolios - Testing weights
05:07
We present portfolio optimisation as a regression and describe F-tests for statistical significance of changes in portfolio weights.
Lecture 55
Portfolio Optimisation - Conditional Portfolios and other performance measures
06:34
We introduce conditional portfolios and optimisation to include dynamic reallocation. Using augmented portfolios allows us to consider dynamic signals in portfolio optimisation.
Finally, we talk about the shortcomings of most MVO style portfolio optimisation, and introduce a number of the standard performance measures used in measurement and allocation problems.
Module 6: Overfitting
36:41
Lecture 56
Intro to Overfitting and the major issues
04:16
We introduce the problem and related issues of p-hacking, lack of reproducibility, and holdout overfitting in Kaggle competitions.
Lecture 57
Overfitting in Finance
05:27
Overfitting in finance is perhaps more problematic than any other field. While Amazon or Google could miss a few keyclicks by relying on spurious results, in finance, we could easily risk insolvency. Meanwhile, overfitting is altogether too common and recent studies have shown its prevalence.
Lecture 58
Dealing with overfitting - increasing backtest length
04:02
Bailey et al have proposed increasing backtest lengths to avoid overfitting. The method is illustrative but provides more of a rule of thumb. We describe the results of their paper on "Financial Charlatanism and Pseudo-Mathematics" and the concept of minimum backtest length
Lecture 59
Adjusted Sharpe Ratios and Multiple Hypothesis Tests
06:11
Harvey and Liu discuss the statistics of Sharpe ratios, converting to p-values (if Sharpe = E[Ret]/Std[Ret], the test is H0: E[Ret]=0). They then discuss multiple hypothesis testing and how one deals with it.
Lecture 60
Multiple Hypothesis Testing - Holm and Bonferroni
06:55
Ways of dealing with Multiple Hypothesis Testing - Holm and Bonferroni methods, somewhat more extreme than optimal but giving some good insight into means of adjusting p-values.
Lecture 61
Multiple Hypothesis Testing - BHY adjustments and Practical Methods to prevent overfitting
09:50
We describe the best method for controlling the rate of false discovery (FDR), the BHY adjustment and we talk about its impact on Sharpe Ratios based on number of strategies run and size of history available for backtest.
Finally, we summarize the practical approaches to backtest overfitting.
Module 7: Course Summary
07:08
Lecture 62
Course Summary
07:08