Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Real-time inflation index for sector rotation strategy

This past fall I went to a great talk by Prof. Rigobon from MIT where he talked about the MIT Billion Prices project, which is collecting real time global online pricing data and compiling their own inflation indices.

I was curious to see how this daily index would perform as a signal to drive a simple (its really simple) sector rotation strategy. In the backtest attached I start off with an equal weighted portfolio of 9 sector ETFs and use the rt BPP index to tilt the portfolio towards inflation defensive sectors in periods of relatively high inflation and towards inflation sensitive sectors during periods of relatively low inflation.

I've included links to the data sources in the algo. Would love to see people's ideas on making this more sophisticated. I used a weekly rebalance here and actually wasn't able to find much benefit in using the daily index vs. the monthly CPI numbers, perhaps a more event driven strategy that looked for times where there is a divergence between the two might be interesting as well.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

3 responses

Jessica, this is interesting. I have a lot of investment experience (and that is investing as opposed to Quantopian-type trading) but little programming experience. I remember the Billion prices project but haven't kept up with it. I thought State Street acquired it. Anyway, are you taking care to lag the CPI to account for the fact that its release comes well after the period for which inflation is being measured? From a fundamental perspective I would expect the source of inflation to impact which sectors benefit. An oil price shock will be different from a rise in labor costs. Also, markets probably react differently to expected from unexpected inflation. Theoretically, markets have discounted expected inflation. It used to be difficult to measure expected inflation. Now with TIPs, a simple estimate of inflation expectations is the yield of a nominal bond less the TIPs yield. I think it would be interesting to see how the sectors react when the real time inflation rate is exceeding the expected rate and vice versa. The implementation would still be limited to inflation in the short run. The real time series gives you a sense of recent prices changes. Thus you would might compare this recent inflation information with the expectation for inflation over the short term (using shorter maturity nominal and TIPs bonds). However the markets may care more about longer term inflation which is not going to be captured by the real time series.

If anyone is still reading, I'd add that the idea of using real-time date (in this case prices to estimate inflation) is fascinating. One might be able to predict surprises in government (and industry or even company) releases. From a trading point of view one would want to be able to predict the value that is going to be released with better accuracy than the consensus. One would trade when one's model produces an estimate different from the consensus estimate which would constitute a surprise and should move markets. I'm thinking of data series like housing starts, permits, prices; auto sales etc. Could one get an idea of this from web traffic; searches; changes in number of listings etc. It sure would be nice to have access to big data from firms like Google or Amazon. I'm pretty sure some hedge funds are on top of this. There's a thread on trading based on Google Trends data which is along these lines.

Hi Rex,

Thank you for your reply - most importantly, thanks for catching that I had actually NOT lagged the data series in my test so far.

I went back and lagged the BLS monthly CPI by 20 calendar days and then ran the same backtest using that as the signal - see backtest attached . This actually looks a lot more like what I expected, which is that it would be more profitable to use the real-time signal than to wait on the monthly number.

In terms of using the real-time indicator, the BPP has spun out a company called Price Stats who maintain the index and license/distribute through State Street via a couple of options - the most expensive being to get the true real-time data. I haven't verified this, but it looks to me like they do make the index publicly available at a 10 day lag, which is shorter than the lag for the monthly number. I will post another backtest showing the results using the daily index + 10 day lag as well.

Your train of thought on predicting surprises in the government releases is exactly the direction I was thinking would be interesting to take this work. Though the literature on State Street's site (and what I heard from Prof Rigobon) both indicate that their intention with this data is NOT to provide a forecast for the next release - you have to imagine that is a big part of why someone would pay for it.

Last note - I know there is competition in this space, there's at least one other company collecting primary data on global inflation - but I haven't had a chance to try to get sample data to do a comparison (see: http://www.premise.com/). And of course as you point out you could take this as general as the Google Trends idea.

Thanks again for your comments and insight, Jess

Here's the same strategy using the daily index (as in the first post) but with a 10 day lag, so simulating making the data available to the algo when the free version of this data would be expected to be publicly available.