# Difference between revisions of "Trend Following"

(Created page with "Trend Following") |
|||

(11 intermediate revisions by 2 users not shown) | |||

Line 1: | Line 1: | ||

− | Trend | + | Trend following is the canonical algorithmic trading strategy. Funds that have popularised trend following include Winton, AHL and QIM, amongst many others. Such funds typically trade futures slowly, aiming to pick up long term macroeconomic trends. Positions may be held from anything from a few months to several years. |

+ | |||

+ | ==Instrument Types== | ||

+ | |||

+ | Trend following is normally done on futures. Futures are used as they are cheap to trade and offer effectively unlimited leverage. | ||

+ | |||

+ | ==How trend following works== | ||

+ | |||

+ | The simplest trend following algorithm is the moving average crossover. It is based on the assumption that the daily distribution of returns can be modelled as a trend plus some Gaussian noise: | ||

+ | |||

+ | <math> | ||

+ | R(t) = \mu + dW | ||

+ | </math> | ||

+ | |||

+ | An [[wikipedia:Moving_average#Exponential_moving_average|exponentially weighted moving average]] is typically used to pick up the <math>\mu</math> trend term, while ignoring the noise. | ||

+ | |||

+ | In the following diagram, we plot two EWMA lines, with 30 and 120 day lookbacks. | ||

+ | |||

+ | [[File:Moving-average-crossover.png]] | ||

+ | |||

+ | Here, we can see that when EWMA(30) > EWMA(120), we are in an uptrend. | ||

+ | |||

+ | A better way to write this then would be: | ||

+ | |||

+ | Forecast = EWMA(fast) - EWMA(slow) | ||

+ | |||

+ | From here, there are two ways to build positions: | ||

+ | * Binary positions - if forecast is positive/negative, go long/short. Makes sense if we're trading a single instrument. | ||

+ | * Continuous positions - if we're trading a number of instruments together, it may make sense to use the strength of the forecast as an indicator. In this case, we would divide the forecast by the absolute average forecast for the time series, so that the forecast <math>f</math> becomes a unitless number between <math> -1 \leq f \leq 1 </math>, with the absolute mean forecast being <math> \bar{|f|} = 0.5 </math>. | ||

+ | |||

+ | === Position Sizing === | ||

+ | |||

+ | ==== Volatility ==== | ||

+ | |||

+ | Volatility is the expected random fluctuation in returns of an instrument. There are different ways of measuring volatility, but the most common is an an exponentially weighted average of the standard deviation, typically with a lookback of 36 days. | ||

+ | |||

+ | The best portfolios produce positive returns with low volatility. The ratio of expected returns to volatility is known as the [[wikipedia:Sharpe ratio]]. | ||

+ | |||

+ | You can translate between a daily volatility and annual volatility by multiplying by a factor of <math>\sqrt{252}</math>, where 252 is the number of trading days in a year. So for example, if the daily volatility was <math>1.6%</math>, the annual volatility would be <math>1.6% \times \sqrt{252} \approx 25.4%</math>. | ||

+ | |||

+ | ==== Target Volatility ==== | ||

+ | |||

+ | One of the benefits of using leveraged products such as futures is that we do not pay cash for them upfront. As everything is bought on margin, we instead decide how much loss we can stomach in a year and work with that. So for example, we might say that we'd want a target volatility of 25%. This means that we'd expect our cash balance to oscillate with a standard deviation of 25% per year. |

## Latest revision as of 11:00, 5 July 2018

Trend following is the canonical algorithmic trading strategy. Funds that have popularised trend following include Winton, AHL and QIM, amongst many others. Such funds typically trade futures slowly, aiming to pick up long term macroeconomic trends. Positions may be held from anything from a few months to several years.

## Contents

## Instrument Types[edit]

Trend following is normally done on futures. Futures are used as they are cheap to trade and offer effectively unlimited leverage.

## How trend following works[edit]

The simplest trend following algorithm is the moving average crossover. It is based on the assumption that the daily distribution of returns can be modelled as a trend plus some Gaussian noise:

An exponentially weighted moving average is typically used to pick up the trend term, while ignoring the noise.

In the following diagram, we plot two EWMA lines, with 30 and 120 day lookbacks.

Here, we can see that when EWMA(30) > EWMA(120), we are in an uptrend.

A better way to write this then would be:

Forecast = EWMA(fast) - EWMA(slow)

From here, there are two ways to build positions:

- Binary positions - if forecast is positive/negative, go long/short. Makes sense if we're trading a single instrument.
- Continuous positions - if we're trading a number of instruments together, it may make sense to use the strength of the forecast as an indicator. In this case, we would divide the forecast by the absolute average forecast for the time series, so that the forecast becomes a unitless number between , with the absolute mean forecast being .

### Position Sizing[edit]

#### Volatility[edit]

Volatility is the expected random fluctuation in returns of an instrument. There are different ways of measuring volatility, but the most common is an an exponentially weighted average of the standard deviation, typically with a lookback of 36 days.

The best portfolios produce positive returns with low volatility. The ratio of expected returns to volatility is known as the wikipedia:Sharpe ratio.

You can translate between a daily volatility and annual volatility by multiplying by a factor of , where 252 is the number of trading days in a year. So for example, if the daily volatility was , the annual volatility would be .

#### Target Volatility[edit]

One of the benefits of using leveraged products such as futures is that we do not pay cash for them upfront. As everything is bought on margin, we instead decide how much loss we can stomach in a year and work with that. So for example, we might say that we'd want a target volatility of 25%. This means that we'd expect our cash balance to oscillate with a standard deviation of 25% per year.