Prev Article: 1 - How Much do You Like the Trade?

Strategy Types

This section details two main strategy categories with differing philoshopies:

Mean Reversion

This chapter on Mean Reversion is mostly based on Ernest Chan's great book Algorithmic Trading

Pasted image 20221207101914.png
Mean Reversion rests on the idea that some price spread eventually goes back to its baseline mean, as illustrated above. The main thesis is that if we find a mean reverting price spread, we can profit by buying when the price spread goes below the mean and selling once it goes back to the mean.

Problem is, assets that exhibit mean reversion by itself is very rare. So to implement this, we sometimes employ Pairs Trading. That is, we look at pairs of assets whose combined price spread exhibit mean reversion. We will look into this more detail below.

In this section we will explore:

Some example implemented mean reversion strategies can be seen here:
https://github.com/Aldo-Aditiya/algo_trading/blob/master/strats/experiments/20220628_s-stat-arb_d-lq45/original.ipynb

Detecting Mean Reverting Assets

A mean reverting asset is an asset with a mean that does not change too much over time. We call this characteristic: Stationary.

There are multiple ways to statistically test for the stationarity of an asset price:

In practice, you use a combination of these tests to filter out assets.

But again, the problem is that it is rare for single assets to exhibit mean reversion. Enter Pairs Trading. The idea behind pairs trading is that we can find a linear combination of two non-mean reverting asset prices that is potentially mean reverting. This is also called Cointegration.

For more intuition on Cointegration, look at the difference between correlation and cointegration below.

High Correlation with no Cointegration
Pasted image 20220628144542.png

High Cointegration with no Correlation
Pasted image 20220628144558.png

The way to detect Cointegration is by using Engle-Granger Method, the steps of which is as follows:

In practice all of the above methods are already implemented in some library so you can just directly use it.

Cointegration is one of the main methods of detecting mean reverting asset prices. There are many more methods of detecting mean reverting asset prices, which is not covered here. To read more, go here:

Implementing Mean Reversion Strategies

So you've found the price spread that you think is mean reverting. But how do you trade it?

For a single asset mean reversion, the idea of trading it is by buying when the price is below some mean measure, and shorting when the price is above the mean measure. But how about in pair trading?

Assume we are given the price spread of the form . Same as in a single asset, the idea is we do long when we expect the price spread to increase, and short when we expect the price spread to decrease.

But we cant directly trade the spread itself, we have to trade on each asset. So doing long and short on the spread translates to:

Note that doing short is not always possible.

So that's the idea of trading mean reverting price spreads. How do we actually implement it? There are a couple of ways:
Pasted image 20221207190624.png

Another thing to note is the question: What happens if instead of reverting back to the mean, the price instead keeps trending down/up? In that case, if the price keeps on doing that, our mean reversion strategy will lose money.

Whether or not the mean reversion will still hold is a tricky question, and is affected by Regime Change.

Plus and Minus of Mean Reversion

Plus

Minus

Momentum / Trend Following

I have not read too deeply into this, so I am not in the position to write about it. You can read more here:


Next Article: 1.2 - Searching for Strategies