Regime Switching System Using Volatility Forecast
Author: Eugene
Creation Date: 12/15/2011 4:05 AM
profile picture

Eugene

#1
To quote the Quantum Financier blog:

Regime Switching System Using Volatility Forecast

QUOTE:
In the same line of thoughts as last post, today we will look at a way to incorporate the GARCH volatility model we introduced yesterday to create a regime switching strategy.

It is often discussed on the blogosphere that high volatility is good for daily MR, see previous editions of the state of short-term mean-reversion report by Michael over at MarketSci here and the moderator of daily follow-through MR series by David at CSS Analytics here and here. Concurrently, a low volatility environment is usually a good environment for trend following strategies; see Jez Liberty’s state of trend following report here.

With this in mind, since we want to maximize our return we want to be trading the appropriate strategy based on the volatility environment. Using volatility we can switch between MR and TF strategies dynamically to better adapt to the current market paradigm. To do this we can classify current volatility by percentile using a 252 day lookback period. The resulting series oscillate between 0 and 1, and is smoothed using a 21 day percentrankSMA (developed by David Varadi) using a 252 day lookback period. We now have a back of the envelope smoothed volatility regime oscillator where reading greater than .5 indicate high volatility and smaller than .5 low volatility in place.

For the following example, the regime switching (RS) strategy will be as follows: if the oscilliator is greater than .5 we trade the MR strategy and we trade the TF strategy when the oscillator is below the .5 treshold. The MR strategy proxy is the RSI2, and the TF strategy proxy is the MA 50-200 crossover for this simple test. Results on the SPY are presented below with equity curves for MR only (red), TF only (blue), buy and hold (green) and RS (yellow). Note that for this test, the input for the volatility is the running 21 day standard deviation of returns (ie. historical volatility).


I've laid down this skeleton code so anybody interested could insert their own TF/MR rules. Note that there are three definitions of volatility there - Chaikin's Volatility (default), ATR and Beta.

Code requires installed Community Indicators library

CODE:
Please log in to see this code.


This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).