Entries by

,

The Correct Vectorized Backtest Methodology for Pairs Trading

Whilst backtesting architectures is a topic on its own, this article dives into how to correctly backtest a pairs trading investment strategy using a vectorized (quick methodology) rather than the more robust event-driven architecture. This is a technique that is very common amongst analysts and is rather straightforward for long-only portfolios, however, when you start to construct long-short portfolios based on statistical arbitrage, strange little nuances start to pop up.

,

Employing Machine Learning for Pairs Selection

In this post, we will investigate and showcase a machine learning selection framework that will aid traders in finding mean-reverting opportunities. This framework is based on the book: “A Machine Learning based Pairs Trading Investment Strategy” by Sarmento and Horta.

A time series is known to exhibit mean reversion when, over a certain period, it reverts to a constant mean. A topic of increasing interest involves the investigation of long-run properties of stock prices, with particular attention being paid to investigate whether stock prices can be characterized as random walks or mean-reverting processes.

,

Copula for Pairs Trading: A Detailed, But Practical Introduction

Let’s Solve a Mystery.

Suppose that you encountered a promising pair of stocks that move closely together, the spread zig-zagged around 0 like some fine needle stitching that sure looks like a nice candidate for mean-reversion bets. What’s more, you find out that the two stocks’ prices for the past 2 years are all nicely normally distributed. Great! You can avoid some hairy analysis for now. Therefore you fit them as a joint-normal distribution for some sanity check and immediately find that it doesn’t look as promising anymore:

For the past two years, there were some major market events, during which the stocks moved together upwards or downwards, depending on if it was good news or bad news. Your bivariate Gaussian model, in contrast, says that such co-moves are very unlikely to happen since they are so close to the tails of the distribution and you better ignore it. What is more annoying is that the stocks tend to move downward together more than going upward, and the bivariate Gaussian distribution says it should be symmetric.

So what went wrong? For this mini example, there are two major pitfalls present:

,

An Introduction to Cointegration for Pairs Trading

Cointegration, a concept that helped Clive W.J. Granger win the Nobel Prize in Economics in 2003 (see Footnote 1), is a cornerstone of pairs and multi-asset trading strategies. Anecdotally, forty years have passed since Granger coined the term “cointegration” in his seminal paper “Some properties of time series data and their use in econometric model specification” (Granger, 1981), yet one still cannot find the term in Merriam-Webster, and some spell checkers will draw a wavy line without hesitation beneath its every occurrence.

Indeed, the concept of cointegration is not immediately apparent from its name. Therefore, in this article, I will attempt to answer the following questions:

,

Climate Change: Banks & Insurers in the Crosshairs

It’s true that the climate has changed before many times during the earth’s history based on the contents of the ice cores that were drilled from the deep ice sheets in Antarctica and Greenland. However, as Figure 1 shows – the pace of the increase and the rise in level in CO2 concentration and temperature have been dramatic (Dlugolecki and Lafled, 2005) (NOAA, 2020). The impact of the increase in temperature is being felt in melting glaciers and polar ice caps, extreme weather events and rise in sea levels. A Boston Consulting Group (BCG) survey of 3,000 people in eight countries, found that 70% of the people are now more aware (than pre-COVID-19) that human activity threatens the climate (Waddell and Beal, 2020).

,

Discrimination of Correlated Random Walk Time Series using GNPR

Discriminating random variables on time-series on both their distribution and dependence information is motivated by the study of financial assets returns. For example, given two assets where their returns are perfectly correlated, are these returns always similar from a risk perspective? According to Kelly and Jiang (2014), the answer is no, because we did not take into account the distribution differences and distribution information. Therefore, there is a need for a distance metric that can distinguish underlying distributions of time-series even if they are perfectly correlated.

,

Exploring the PMFG Portfolios for Covid-19 Robustness

This blog post explores the impacts of Covid-19 by simulating two investment portfolios – a portfolio consisting of peripheral stocks, versus a portfolio consisting of central stocks in the Planar Maximally Filtered Graph. The goal was to highlight the repercussions of the Covid related decline in the market, which shook the world in mid-February (in the case of the US markets). The portfolios take positions at the worst possible timing in order to understand – had you invested just before the dramatic crash of the market, how would a peripheral portfolio behave compared to a central portfolio? Are peripheral portfolios any better during an unexpected crisis?

,

CorrGAN: Realistic Financial Correlation Matrices

There are 6 properties that empirical correlation matrices exhibit that no synthetic generation method has been able to replicate, until now.

Enabling researchers to backtest strategies on an abundance of data would make our algorithms and strategies more robust, accurate, and efficient. Since historical data can be biased and does not have enough high-stress events to test multiple scenarios, generating synthetic data is a practical way to overcome this problem. However, generating data that is realistic is not an easy task.