Back to Community
QuantCon 2016: Peculiarities of Volatility by Dr. Ernest Chan

Hello Community,

I used the Quantopian IDE and Research environment to replicate the study presented by Ernest Chan at QuantCon this year.
Attached is a notebook which gives a brief summary of his talk, two derived strategies, their rationale, and their performances over the past 7 years. Click clone on this notebook and press shift+enter on each cell to reproduce the study.

The GARCH model and algorithm logic I used to replicate the study are rudimentary. Clone the algorithm below and see what happens with a more sophisticated model that trades a wider range of securities using different signals. For an overview of GARCH models, check out the Quantopian Lecture on the topic.

Loading notebook preview...
Notebook previews are currently unavailable.
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.

14 responses

Here's the first algorithm, which uses the GARCH(1,1) to signal shorting the VXX. Clone it and try it out with some other models.

Clone Algorithm
266
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 577d63a0a2f9b60f9a29bdf7
There was a runtime error.

And the second, which uses Quandl Data find the settle price of VX1 futures, then uses that as a long/short signal.
Clone this one and implement some other interesting models!

As an aside, the comment on line 95 of this algorithm is no longer relevant. It also appears on line 80 of the first.
# Use the look-ahead data as a defacto volatility prediction

There is no imported data in the first algorithm, and the quandl data is time-shifted in the second. (On line 40)
f = df.tshift(1, freq='b')

Clone Algorithm
266
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5783f9777d65070f868fc6c5
There was a runtime error.

It took me a couple of reads to really get the relationships you/ernie are describing, but I think I have a simpler way of explaining:

When today has a negative return on SPY, it's likely that implied volatility has increased today. People were scared into buying more insurance. Generally, implied volatility at an elevated state like this tends to fall the next day. Thus a negative return on SPY is likely to be followed by a reduction in implied volatility the next day.

A positive return on spy tends to be good news, and no one feels the need to buy more insurance, so implied volatility also falls the next day.

Generally speaking, implied volatility spikes quickly but falls slowly, hence on both good days and bad days for the market it can still fall on average.

The situation you describe with a very negative return on SPY might not be that statistically significant. I haven't checked.

My trading strategy takes the following route:

First, a good predictor for future realised volatility is historic realised volatility. Yesterday's weather is a pretty good predictor of today's weather.

If implied volatility is higher than this prediction, then it's in an "elevated state" and is likely to come down, so you short VXX. Otherwise long VXX.

Sorry, I should point out that implied volatility is usually a few percent higher on the long run than realised volatility. This means my strategy has an inherent bias to shorting VXX (i.e. selling volatility insurance) which is good, as it then benefits from the usual contango in VX (aka volatility risk premium).

"Shorting the VXX" is a "sure" way to make money and you don't need an indicator to do it - just keep shorting and stay put and wait.

The only small caveat is that this is not possible to do - Quantopian lets you "short" it, but your broker will not, since it is HTB or NTB (hard to borrow or none to borrow).

There is nothing new under the sun when it comes to short vol strategies.

You can go long XIV and rebalance every day, which is pretty close to shorting VXX. There is the risk that fund blows up if VIX spikes sufficiently, but at least they manage that risk intra-day. Much safer than shorting VXX yourself on Q!

Buy and hold XIV is one strategy I've seen to harvest the VRP you've mentioned. It does suffer from very deep DD though, and I think even a simple trading system like the one I use can improve this performance.

Simple strategy attached.

In Ernie's presentation he suggests this strategy:

RV(t+1) is the GARCH-predicted realized volatility for next period. If this is greater than IV(t) = VIX(t), then buy VXX and vice versa.

I've replaced the GARCH model for realized volatility with just the standard deviation of the last 5 days. Might be fun to see which predictor is more accurate!

Note, the huge IV spike looks like an error in the Yahoo VIX data.

Clone Algorithm
91
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5788c5c046b41111f78bca23
There was a runtime error.

@Lotanna I think you have an error in your code. You are using the price of SPY instead of the log return?

Hey, Is there any way through which I can reduce volatility of the generated returns?

@Hemant

Is there any way through which I can reduce volatility of the generated returns?

Certainly, just use less volatile instruments or reduce leverage.

Below is tear-sheet of the same strategy using less volatile instruments QQQ and IEF.

Loading notebook preview...
Notebook previews are currently unavailable.

Hi Vladimir,

That was great help. Can you share the algorithm as it will provide more clarity in terms of your thought process.

@Hemant,

Can you share the algorithm ?..
By some, known only to Quantopian staff, reasons I do not have ability to attach my backtests to posts since April 2017.

@Vladimir: Do you have the ability to paste code into your posts?

@André.

I just replaced XIV by QQQ, VXX by IEF in last Burrito Dan code and run back-test from 2007-06-01