Trend Following

From Algorithmic Trading
Jump to: navigation, search

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:

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


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

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.