A quant’s annoyance…continuous futures contracts

Data work.... ugh.  Source: Google images

Data work…. ugh. Source: Google images

Just a small vent today.  I’m deep in the middle of creating my own series of continuous futures contracts, which is both dull and so very important that there’s nothing for it.  I can understand why pre-made series (at least for intraday granularity) cost a fortune.

For those wondering what I’m talking about: futures contracts, like most derivatives, have a finite lifespan.  If I want to go long the S&P 500, I might buy a March 2015-expiry S&P 500 future.  So far, so good.  The issue comes in backtesting quant strategies: one needs to ‘stitch’ these contracts together to create one series for long-term testing purposes.

But wait.  It’s not quite that simple.  Due to various factors, one frequently comes across big price jumps between 2 futures contracts.  What to do?  Depending on the use-case, there are multiple different adjustments that might be appropriate for creating the series.  The most exotic sounding, to me, is the ‘Panama’ method…which is incidentally about the simplest adjustment out there.

Once I’m through downloading many millions of data rows, then back adjusting the futures contracts, I will finally have a time series with reasonable reliability.  Then I just need to remember to keep up the process as life continues.

Perhaps another reason to leave the futures trading to paid professionals.

Advertisements

3 thoughts on “A quant’s annoyance…continuous futures contracts

  1. Relax. Did you know that http://www.quandl.com have continous series, albeit not for all contracts? Also the simplest method is the best, as used by one of the biggest managed futures firms, so I’ve heard (I couldn’t possibly say myself, as I signed an NDA bigger than my house).

    It is a fair bit of upfront work, but once you’re actually trading keeping it updated just becomes part of your daily routine.

    Here’s a very quick list of what I did, when I went through this pain myself about a year ago:

    – try stitching the contracts with a roll date that is the same offset to the expiry.
    – for any that don’t work (no prices on the roll date perhaps), manually move the date around

    This is all automated in python, with the ‘first go’ at the roll dates produced into a .csv which I then manually edited, before trying the stitching process again.

    Like

    • Thanks Rob. I’m well-versed in the Quandl offering, which is quite helpful for daily data. Now I’m doing the same operation with intraday stuff – would like to look at timeframes in the minutes!

      Having now loaded about 25GB of futures quotes into a MySQL database, it’s time to get to work doing the backfilling. I’ll plan to find the roll dates using daily data, then save off for use in the intraday stuff.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s