Rebuilding PyPortfolioOpt: an Open Source Adventure

[ programming ]

A few weeks ago, a user raised an issue on the GitHub repository for PyPortfolioOpt, my open-source portfolio optimisation software library. In this nontechnical post, I discuss why a seemingly innocuous error resulted in a ground-up rebuild of a large chunk of PyPortfolioOpt, and share some reflections on open-source in general.

Read more...

Black-Litterman allocation in algorithmic trading

[ quant-finance ]

In December 2019, I released a major update to PyPortfolioOpt, my python portfolio optimisation package. The most significant addition was an implementation of the Black-Litterman (BL) method. Although BL optimisation is commonly used as part of a pipeline to optimise a multiasset/equity portfolio, in this post I argue that BL is particularly well suited to the problem of optimally weighting signals in an algorithmic trading context.

Read more...

An asymmetric bet on interest rates

[ finance ]

In this post, we discuss how asymmetric bets can be evaluated with the expected value. Following this, I argue that the market was overestimating the probability of a rate cut in July 2019 and examine how the inherent asymmetry of the situation can set the stage for a profitable macro bet.

Read more...

How predictive is the historical volatility?

[ quant-finance ]

One of the things that makes markets exciting (or frightening) is that prices move around a lot. It is important to be able to describe and predict the range of possible price movements over a given time horizon since some investors might desire assets whose prices don’t move up and down too much. We can quantify this by computing the volatility, which is commonly defined to be the standard deviation of the asset’s (log) returns. This post examines how well we can predict future volatility and why that matters.

Read more...

Implementing k-means clustering from scratch in C++

[ programming ]

In this post, I describe the k-means algorithm and provide a simple implementation in C++ along with a simple plotting routine in python.

Read more...

What we learnt building an enterprise-blockchain startup

[ blockchain ]

It has been almost a year since the idea of HyperVault was first conceived. In that time, we built HyperVault up from a single sentence, gained and lost team members along the way, developed a functional proof-of-concept over the short winter holidays, crashed out of a few competitions (also won a couple of prizes), and finally decided to open source. This post aims to be an honest reflection on the journey – highlighting both the good bits and the times we wanted to give up.

Read more...

Graph algorithms and currency arbitrage, part 2

[ quant-finance ]

In the previous post (which should definitely be read first!) we explored how graphs can be used to represent a currency market, and how we might use shortest-path algorithms to discover arbitrage opportunities. Today, we will apply this to real-world data. It should be noted that we are not attempting to build a functional arbitrage bot, but rather to explore how graphs could potentially be used to tackle the problem. Later on we’ll discuss why our methodology is unlikely to result in actionable arbitrage.

Read more...

Graph algorithms and currency arbitrage, part 1

[ quant-finance ]

In this post we briefly outline how graph theory can be used to systematically find arbitrage opportunities in foreign exchange markets.

Read more...

Portfolio optimisation: lessons learnt

[ quant-finance ]

Over the past few months I have been busy doing a mixture of blockchain consulting and quantitative finance work for a couple of companies in South East Asia. In particular, I have had the opportunity to investigate the interesting problem of portfolio management for cryptoassets – it was not my first experience with portfolio optimisation, having implemented efficient frontier portfolios at a roboadvisor startup, but this time I took the opportunity to do a deep dive into the subject.

Read more...

Exponential Covariance

[ quant-finance ]

In this post, I describe a method of computing covariance matrices that gives additional weight to recent observations. This is particularly important in the field of financial portfolio optimisation, wherein a better estimate of future covariance can create significant value.

Read more...