Using Apache Airflow to Extract CoT Data

In today’s post we are going to be extracting CoT (Commitment of Traders) reports from the CFTC website using a pipeline built on Apache Airflow. What is CoT data? The CoT report is a weekly publication which reports the open positions of market participants in the U.S futures market. It’s published every Friday at 3:30 …

Read more

Efficiently Simulating Geometric Brownian Motion in R

For simulating stock prices, Geometric Brownian Motion (GBM) is the de-facto go-to model. It has some nice properties which are generally consistent with stock prices, such as being log-normally distributed (and hence bounded to the downside by zero), and that expected returns don’t depend on the magnitude of price. Of course, GBM is just a …

Read more

Parameter Optimisation for Systematic Trading

Optimisation tools have a knack for seducing systematic traders. And what’s not to love? Find me the unique set of parameters that delivered the greatest return in my ten-year backtest. And do it in under five seconds. That’s certainly attractive. But do you want to hear something controversial? When it comes to the parameters of …

Read more

A Review of Zorro for Systematic Trading

One of the keys to running a successful systematic trading business is a relentless focus on high return-on-investment activities. High ROI activities include: Implementing new trading strategies within a proven framework. An example might be to implement a portfolio of pairs trades in the equity market. Scaling existing strategies to new instruments or markets. For …

Read more

Revenge of the Stock Pickers

To say we’re living through extraordinary times would be an understatement. We saw the best part of 40% wiped off stock indexes in a matter of weeks, unprecedented co-ordinated central bank intervention on a global scale, and an unfolding health crisis that for many has already turned into a tragedy. As an investor or trader, …

Read more

A Vector Autoregression Trading Model

The vector autoregression (VAR) framework is common in econometrics for modelling correlated variables with bi-directional relationships and feedback loops. If you google “vector autoregression” you’ll find all sorts of academic papers related to modelling the effects of monetary and fiscal policy on various aspects of the economy. This is only of passing interest to traders. …

Read more

The Graphical Lasso and its Financial Applications

Way back in November 2007, literally weeks after SPX put in its pre-GFC all-time high, Friedman, Hastie and Tibshirani published their Graphical Lasso algorithm for estimation of the sparse inverse covariance matrix. Are you suggesting that Friedman and his titans of statistical learning somehow caused the GFC by publishing their Graphical Lasso algorithm? Not at …

Read more

Kalman Filter Pairs Trading with Zorro and R

In the first three posts of this mini-series on pairs trading with Zorro and R, we: Implemented a Kalman filter in R Implemented a simple pairs trading algorithm in Zorro Connected Zorro and R and exchanged data between the two platforms In this fourth and final post, we’re going to put it all together and …

Read more