Month: November 2012

Wholistic Thinking

An engineering risk analyst thinks in terms of systems, their functional components and their dependencies, Paté-Cornell said…… Therefore, the analyst must first understand the ways in which the system works as a whole to identify how it could fail.

– Kelly Servick from How ‘black swans’ and ‘perfect storms’ become lame excuses for bad risk management

Advertisements

XIV Donchian 50/25 Breakout Trading System

While surfing through the internet I found simulated VXX and XIV data going back to 2004. Here is the VXX data and here is the XIV data.

I’ve decided to trade a 50/25 Long-Only Donchian Breakout system on XIV, despite the fact that an Oscillator based system on VXX resulted in better risk/adjusted performance (long/short systems), simply because the brokerage I use does not have shares of VXX to short. The rules of the system are simple:

Buy: The close of today is higher than yesterday’s 50-day high of the close.

Sell: The close of today is lower than yesterday’s 25-day high of the close.

I use a 20% stop loss. This system was visually optimized, meaning I looked at the chart below while adjusting the parameters and chose parameters with round numbers that seemed to have the best risk/adjusted returns.

Visual Optimization

Here are the results of the system based off of the simulated data from above going back to 3/26/2004 and ending in 11/26/2012:

Result

I’ve allocated approximately 25% of my capital to this system. Friday afternoon (11/23/2012) a buy signal was generated. I bought 150 shares on the following Monday using a limit order, and managed to get filled at 18.65. I plan to follow this system until it experiences an 80% draw-down. In the future I will create a long only VXX system to use while this system is in cash.

There are two arguments against this system (or similar systems) that I’ve found:

1) 1987 style crashes will eat all the profits, and then some, that this system has generated. Found at Six Figure Investing’s post: “A Brief History of Fear.”

2) There is too little data to tell. The data dating back to 2004 only shows one current regime. According to user Damian Bergamaschi, a commenter on the post “Alpha Strategy” at Don’t Fear the Bear, “My findings show that the years 00-jan03 the market spent more days backwardated than in contango and 96-98 was almost the case as well.”

My refutations:

1) I can’t think of any reason not to be worried about this. I can only hope that my system will somehow exit before a crash of this magnitude. While the possibility of a crash of this magnitude happening within a day is slim, history has proven that it is still a possibility. If someone has an idea to safeguard against this, please share 🙂

2) I don’t think that a market with more contango than backwardation is only a regime. I think the markets have fully incorporated the fact that if there were as many days in backwardation as there is in contango, than investors could generate alpha relatively easily by using VIX-ETPs as a hedge. I could be wrong, but even if I am, the exit on a 25-day low should prevent the system from losing too much money in a backwardation environment.

Shorting Leverage

I came across the paper “Embedded Leverage” by Andrea Frazzini and Lasse Heje Pedersen. I didn’t have time to read it, but skimming over the abstract did spark some ideas from a previous paper I read. In the abstract, it states “we find that asset classes with embedded leverage offer low risk-adjusted returns and, in the cross-section, higher embedded leverage is  associated with lower returns. A portfolio which  is long low-embedded-leverage  securities and short high-embedded-leverage  securities  earns large abnormal returns, with t-statistics of  8.6 for equity options, 6.3 for index options, and 2.5 for ETFs.” This made me think of a previous paper I read, titled “Alpha Generation and Risk Smoothing using Volatility of Volatility” by Tony Cooper. In that paper, he talks about “Volatility Drag”, which is the deterioration of performance due to volatility, which can be seen by the following formula:

(1-x)(1+x) = 1-x^2

In leveraged ETFs, this volatility drag effect is amplified.

Thinking about both of those papers made me hypothesize that a portfolio consisting of shorting 3x leveraged ETFs could perform extremely well from two factors:

  1. The high “embedded leverage”
  2. The increased volatility drag

To test this hypothesis out, I backtested 3 systems shorting pairs of 3x leveraged ETFs. The pairs were chosen so that there was 1 inverse ETF and 1 regular, and that they were created by the same company. I chose inverse/non-inverse pairs so that the majority of the movements would cancel each other out and create a smoother equity curve, and I chose ETFs from the same company so that the pairs would have similar (but inverse) indexing methodologies. The positions were rebalanced daily using adjusted close prices from Yahoo! Finance. Commission and slippage were not accounted for. The ETF pairs are:

  • UPRO/SPXU
  • FAZ/FAS
  • GASL/GASX
  • RUSS/RUSL
  • TECL/TECS

There was no reason these particular ETFs were chosen. I just went to ETFdb.com and screened for 3x leveraged equity ETFs and ranked the ETFs by AUM. Then I chose a couple pairs.

FAS-FAZ Equity Curve

GASL-GASX Equity CurveRUSL-RUSS Equity Curve TECL-TECS Equity Curve SPXU-UPRO Equity Curve

While viewing these charts keep in mind that the testing period for some ETFs were longer than others, which will affect cumulative return.The returns for most of them are mediocre at best, but the equity curve is relatively stable. What worries me is the pair TECL/TECS. While such a drop has only occurred to 1/5 of these pairs, this kind of black swan event could ruin the strategy and is enough to warrant not implementing the strategy.

Next I will try to find evidence that the returns are derived increased volatility drag through by plotting the rolling 10-day return of the strategy with the rolling 10-day historical volatility of the strategy.

FAS-FAZ Volatility GASL-GASX Volatility RUSL-RUSS Volatility SPXU-UPRO Volatility TECL-TECS Volatility

From a cursory glance, volatility doesn’t seem to be a huge predictor of returns in any of the pairs except for FAS/FAZ.

Conclusion:

This strategy doesn’t generate enough alpha to warrant trading IMO. Even though it has a stable equity curve (depending on the securities traded) black swan events such as the one that occurred in TECS/TECL can devastate the already small profits. This combined with the fact that the system trades extremely frequently (once per day) and thus has relatively large commissions should counter-act any benefits the strategy has. Other than researching if the volatility of 1 of the ETFs is a predictor of  future returns, I’m not sure where else to continue researching/developing this strategy. If anyone has any thoughts/ideas please feel free to share 🙂

Side Note: This is the first time I’m using R. Everything should be calculated correctly, but I’m posting the code for this strategy so someone can point out an error in case I calculated something incorrectly.

# Function
getInvRet <- function(x) #Gets Inverse Daily Return
{
    raw.close <- read.csv(x) # read from CSV
    close <- raw.close[,7] # get Adjusted Close
    close <- rev(close) # flip the data
    ret <- close[-1]/close[-1*length(close)] # convert to daily ret
    inverse.ret <- -1*(ret-1) + 1 # inverse it for shorting
    inverse.ret
}
getPairRet <- function(retA, retB) #Calculates Shorting Rebalance Return
{
    equity <- retA * .5 + retB * .5
    equity <- c(1,equity)
    equity
}
movsd <- function(equity,lag) #Rolling Standard Deviation
{
    movingsd <- vector(mode="numeric",length(equity)-lag+1)
    for(i in lag:length(equity)) {movingsd[i-lag+1] <-sd(equity[(i-lag+1):i])}
    movingsd
}
movRet <- function(equity,lag) #Rolling Returns
{
    #for(i in 1:lag){}
    #for(i in length(equity)-lag+1:length(equity){}
    equity <- cumprod(equity)
    movingRet <- vector(mode="numeric",length(equity)-lag+1)
    for(i in lag:length(equity)) {movingRet[i-lag+1] <-equity[i]/equity[(i-lag+1)]} # this should be vectorized
    movingRet

}
#Get Inverse Returns
ret.fas <- getInvRet("fas.csv")
ret.faz <- getInvRet("faz.csv")
ret.gasl <- getInvRet("gasl.csv")
ret.gasx <- getInvRet("gasx.csv")
ret.rusl <- getInvRet("rusl.csv")
ret.russ <- getInvRet("russ.csv")
ret.spxu <- getInvRet("spxu.csv")
ret.upro <- getInvRet("upro.csv")
ret.tecl <- getInvRet("tecl.csv")
ret.tecs <- getInvRet("tecs.csv")

#Get Short Leverage Equity Curve
fas.faz <- getPairRet(ret.fas,ret.faz)
gasl.gasx <- getPairRet(ret.gasl,ret.gasx)
rusl.russ <- getPairRet(ret.rusl,ret.russ)
spxu.upro <- getPairRet(ret.spxu,ret.upro)
tecl.tecs <- getPairRet(ret.tecl,ret.tecs)

Mean-Reversion within Regimes

The standard “index” for mean-reversion strategies uses the following rules:

  • Buy/Cover = Close < Yesterday’s Close
  • Sell/Short = Close > Yesterday’s Close.

I will test this simple strategy within different regimes too see how regimes influence mean-reversion strategies as a whole. I will test this on SPY from 1/1/2000 – 7/30/2012 using Yahoo! Finance data. I chose these particular dates because mean-reversion as a whole performed poorly until the year 2000 and has performed relatively strongly for the majority of the testing period.

  • First, for the test of the simple trading rules above to establish a baseline to compare the future results to.
  • CAGR: 10.46%
  • MDD: 31.32%

For some reason, ever since 2009-ish this strategy has not performed as strongly. Below is the equity chart of this system.

MR Portfolio Equity

Bull/Bear:

To classify Bull and Bear Regimes I used the RSRank Indicator described by Jeff Swanson in this post at System Trader Success.

  • Bull: RSRank > 0
  • Bear: RSRank < 0

Results:

Bull:

  • CAGR: 0.07%
  • MDD: 38.74%

Bear:

  • CAGR: 10.40%
  • MDD: 27.58%

This clearly shows that MR seems to only perform well in Bearish conditions.

High/Low Volatility:

For determining High/Low Volatility regimes I will be using the 60-day standard deviation of daily returns.  The classifications for High-Volatility and Low-Volatility with the 60-day standard deviation of daily returns

  • HV: 60-Day Standard Deviation of Daily Returns > 0.01
  • LV: 60-Day Standard Deviation of Daily Returns < 0.01

Results:

HV:

  • CAGR: 9.25%
  • MDD: 36.21%

LV:

  • CAGR: 1.11%
  • MDD: 28.08%

This shows shows that MR performs well during high volatility environments.

Trending/MR:

The TSI is an indicator created by Frank Hassler from Engineering Returns and David Varadi from CSS Analytics. The formula can be found here. The classification for Trend Vs MR with the TSI():

  • Trending: TSI()>1.6
  • MR: TSI()<1.6

Results:

Trending:

  • CAGR: -1.86%
  • MDD: 34.24%

MR:

  • CAGR: 12.56%
  • MDD: 20.88%

It’s obvious that this strategy should work well during mean-reverting regimes, and that this strategy should perform poorly during trending periods. More than anything, the results of this particular test verify that TSI is a suitable indicator for determining mean-reverting and trend-following regimes.

Conclusion:

From this we should be able to see that mean-reversion trading strategies tend to work well when the regime is classified as mean-reverting by the TSI, when the market is bearish, and when the volatility is high.