In my last post I showed what a linear regression curve was, this post will use it as part of a mean reverting trading strategy.

The strategy is simple:

Calculate a rolling ‘average’ and a rolling ‘deviation’

If the Close price is greater than the average+n*deviation go short (and close when you cross the mean)

If the Close price is less than the average-n*deviation go long (and close when you cross the mean)

Two cases will be analysed, one strategy will use a simple moving average(SMA), the other will use the linear regression curve(LRC) for the average. The deviation function will be Standard Devation, Average True Range, and LRCDeviation (same as standard deviation but replace the mean with the LRC).

Results (Lookback = 20 and Deviation Multiplier = 2:

Annualized Sharpe Ratio (Rf=0%)

GSPC = 0.05257118

Simple Moving Avg – Standard Deviation = 0.2535342

Simple Moving Avg – Average True Range = 0.1165512

Simple Moving Avg – LRC Deviation 0.296234

Linear Regression Curve – Standard Deviation = 0.2818447

Linear Regression Curve – Average True Range = 0.5824727

Linear Regression Curve – LRC Deviation = 0.04672071

Optimisation analysis:

Annoyingly the colour scale is different between the two charts, however the sharpe ratio is written in each cell. Lighter colours indicate better performance.

Over a 13year period and trading the GSPC the LRC achieved a sharpe of ~0.6 where as the SMA achieved a sharpe of ~0.3. The LRC appears superior to the SMA.

I will update this post at a later point in time when my optimisation has finished running for the other strategies.