VXX Directional Trading Strategy Part 1

The idea behind this trading strategy is to be long VXX for the majority of the time in order to capture the contango effects of VIX futures. I chose VXX because this ETN has one of the longest sets of data out of all the Volatility ETPs. My goal is to stay out of the market while the VIX is moving up a significant amount, or while VIX futures are in backwardation. All the data used is daily data from Yahoo! Finance.

My commissions are set at 7$ per trade with a capital base of 10,000$. All signals are based on the opening price of the day after the signal was generated. The software used is AmiBroker. The objective function used in optimization and walk-forward analysis is RAR/MDD. The data is from 1/30/2009 – 7/30/2012. The RAR/MDD of short & hold (the benchmark we are trying to beat) is 1.17.

I have a couple thoughts on how to execute this strategy, but for this post I’m just going to test a system with signals based on whether or not the VIX is above/below a certain constant value.

Rules:

  • Buy or Exit-Short when the VIX is above a constant buy value
  • Sell or Exit-Long when the VIX is below a constant sell value

Below is the AFL code for this strategy

// Constant Directional VXX Trading Strategy
// Set trade delays and prices
SetTradeDelays(1,1,1,1);
BuyPrice = ShortPrice = CoverPrice = SellPrice = O;

VIX = Foreign("^VIX","C");
SellValue = Optimize("Sell",35,2,80,2);
BuyValue = Optimize("Buy",60,2,80,2);
Buy = Cover = VIX > BuyValue;
Sell = Short = VIX < SellValue;
Optimization for Constant Buy/Sell values

This optimizes the values of VIX where VXX is bought/sold. The water line represents the RAR/MDD of short & hold.

From the picture above it seems that there is only 1 region that is stable and has a higher RAR/MDD than short & hold (which is 1.17, a little below the water line).

  1. Buy is 54+, and sell is 22-40.

This is a detailed backtest report for when Buy = 60 and Sell = 35. I chose these values because they seem to be well within the stable area.Statistics for the Constant Buy = 60 Sell = 35 SystemReport Chart for the Buy = 60 Sell = 35 System

Compares short & hold, buy & hold, and equity curve of the strategy

This compares the results of the strategy (green/red) with short & hold (red) with buy & hold (blue)

We can tell from the 3 pictures above that the backtest from the selected values doesn’t differ that much from going short & holding. The only difference is a short period near the beginning of the backtest where the selected values didn’t trade, resulting in a higher objective function for the selected values. Another fact that casts further doubt on the validity of the system is that there was only one trade through the entire 2+ year period, meaning that the result is not statistically significant.

Next, I will see how this system (or a variation of this system) works with stop losses and profit targets. I will change the system a little bit so that I can optimize the inputs and keep making 3D charts.

Rules:

  • Buy or Exit-Short when VIX > a constant value
  • Sell or Exit-Long when VIX < a constant value (which will be the same as above)
  • Exit-Short/Long with a % profit target

The code will only be a little different:

// Constant Directional VXX Trading Strategy
// Set trade delays and prices
SetTradeDelays(1,1,1,1);
BuyPrice = ShortPrice = CoverPrice = SellPrice = O;

VIX = Foreign("^VIX","C");
ConstantValue = Optimize("Constant",35,2,80,1);
StopValue = Optimize("Stop",5,0,100,1);
Buy = Cover = VIX > ConstantValue;
Sell = Short = VIX < ConstantValue;
ApplyStop(1,1,StopValue,0,False,0);
Constant Stop Loss Optimization

This optimization optimizes a constant value of VIX where the VXX will be bought/sold, and the % profit target. The water line represents the RAR/MDD of short & hold.

 

There are only a couple regions above the water line, all of which aren’t particularly stable and seems to be the result of curve-fitting. The waterline represents a RAR/MDD that is slightly above the performance of short & hold.

My hypothesis is that the region where Buy is 64 has an objective function that is curve fit. I think that it has such a high RAR/MDD because if it is stopped out before any significant drawdowns, and is never signaled back into the trade (and thus has a lower exposure), which seems like the case, than the RAR/MDD will be relatively high even though the performance is subpar. I will test when Profit Target = 64 and Buy = 54+ to verify this hypothesis.

  1. Profit Target is 64%, and Constant Value is 60

This is the detailed backtest for when stop is 64 and constant value is 60.Statistics for the 64-60 System

Chart Report for the 60-64 SystemComparative chart for the 60-64 system

This system with profit targets of 64% and Buy of 60, only results in 4 trades, meaning that the results of this test are not statistically significant. Even though this system does have a higher RAR/MDD and CAR than short & hold and/or the original optimized system, it seems as though the results are from curve-fitting.

I am  only going to test the system with a trailing stop loss and not a maximum stop loss since it is pretty clear, visually, that VXX never goes above the initial price, and from the first test, we can see this system is very similar to short & hold so it is safe to assume that a maximum stop loss would not drastically affect the system.

The only part of the code we need to change to test a trailing stop is the very last line:

ApplyStop(2,1,StopValue,0,False,0);
Optimization of Trailing Stop Loss

This is an optimization of the % trailing stop loss vs the constant value of VIX where VXX will be bought/sold. The water line represents the RAR/MDD of short & hold.

This optimization shows that there is a stable region in the corner of the optimization chart with about Buy = 54 + and Stop  = 90+.  The region is exactly flat, meaning that it all of the systems with those variables will have similar if not exactly the same trades, and thus meaning that that entire region is

Here is a detailed backtest report for when Buy = 60 and Stop = 95:

Trailing Stop Loss Statistics ReportTrailing Stop Loss Chart Report

Once again the results of this system aren’t statistically significant due to the low amount of trades.

In conclusion, all of these systems didn’t both outperform short & hold by a significant amount and produce statistically significant results/results not a product of curve-fitting, so non of these systems are trade-worthy.

I will post research for signals based on an oscillator such as William’s %R, Stochastic, or RSI at Part 2 of VXX Directional Trading Strategy.

Advertisements

One comment

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