Description Usage Arguments Details Value References
View source: R/contango_simple.R
Simple strategy: Each day, hold XIV if contango > xiv.cutpoint
, hold
VXX if contango < vxx.cutpoint
, and hold cash otherwise. Perhaps not
very useful since XIV closed on Feb. 20, 2018.
1 2  contango_simple(contango, xiv.gains = NULL, vxx.gains = NULL,
xiv.cutpoint = 0, vxx.cutpoint = Inf, initial = 10000)

contango 
Numeric vector of contango values at the end of each trading day. 
xiv.gains 
Numeric vector of gains for XIV. Should be same length as

vxx.gains 
Numeric vector of gains for VXX. Should be same length as

xiv.cutpoint 
Numeric value giving the contango cutpoint for XIV, in percent. 
vxx.cutpoint 
Numeric value giving the contango cutpoint for VXX, in percent. 
initial 
Numeric value giving the initial value of the portfolio. 
You can find historical contango values from The Intelligent Investor Blog. You can click the first link at http://investing.kuchita.com/2012/06/28/xivdataandpricingmodelsincevixfuturesavailable2004/ to download a zip file containing an Excel spreadsheet. Then, you will need to calculate whatever version of "contango" you prefer. I typically define contango as what percent higher the secondmonth VIX futures are acompared to the firstmonth futures, i.e. dividing the "2nd mth" column by the "1st mth" column, subtracting 1, and then multiplying by 100.
I think the most common approach for contangobased volatility strategies is
holding XIV (inverse volatility) when contango is above some value (e.g. 0%,
5%, or 10%), and holding cash otherwise. You can do that with this function
by leaving vxx.cutpoint
as Inf
. However, you may also want to
hold VXX (volatility) when contango is below some value
(e.g. 0%, 5%, 10%), also known as "backwardation". You can implement an
XIVonly, VXXonly, or XIV and VXX strategy with this function.
To load daily gains for XIV and/or VXX, you can use load_gains
,
which uses the quantmod package [1] to load data from Yahoo! Finance.
You will have to specify the from
and to
inputs to match the
date range for your contango values.
List containing:
Character vector named holdings
indicating what fund was held
each day (XIV, VXX, or cash).
Numeric vector named port.gains
giving the portfolio gain for
each day, which will be 0 for days that cash was held and the XIV or VXX gain
for days that XIV or VXX was held.
Numeric vector named port.balances
giving the portfolio balance
each day.
Numeric value named trades
giving the total number of trades
executed.
Ryan, J.A. and Ulrich, J.M. (2017) quantmod: Quantitative Financial Modelling Framework. R package version 0.412, https://CRAN.Rproject.org/package=quantmod.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.