Description Usage Arguments Details Value Note Author(s) References Examples
Implements the following volatility strategy: Each day, hold XIV/SPXU (weighted
for zero beta) if contango is greater than xiv.spxu.cutpoint
, hold
VXX/UPRO (weighted for zero beta) if contango is less than
vxx.upro.cutpoint
, and hold cash otherwise.
1 2 3 4 5 6  contango.hedged(contango,
xiv.spxu.gains = NULL, vxx.upro.gains = NULL,
xiv.spxu.cutpoint = 6.36, vxx.upro.cutpoint = 5.45,
xiv.allocation = 0.46, vxx.allocation = 0.46,
xiv.beta = NULL, vxx.beta = NULL,
initial = 10000)

contango 
Numeric vector of contango values at the end of each trading day (or week, month, etc.). 
xiv.spxu.gains 
2column numeric matrix of gains for XIV and SPXU. Number of rows should match
length of 
vxx.upro.gains 
2column numeric matrix of gains for VXX and UPRO. Number of rows should match
length of 
xiv.spxu.cutpoint 
Numeric value giving the contango cutpoint for XIV/SPXU position. For example,
if 
vxx.upro.cutpoint 
Numeric value giving the contango cutpoint for VXX/UPRO position. For example,
if 
xiv.allocation 
Numeric value indicating XIV allocation for XIV/SPXU positions. For example, if
set to 0.46, then 46% is allocated to XIV and 54% to SPXU when contango is
greater than 
vxx.allocation 
Numeric value indicating VXX allocation for VXX/UPRO positions. For example, if
set to 0.46, then 46% is allocated to VXX and 54% to UPRO when contango is less than than 
xiv.beta 
Numeric value indicating XIV's beta. If specified, the function figures out what

vxx.beta 
Numeric value indicating VXX's beta. If specified, the function figures out what

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 first month futures, i.e. dividing the "2nd mth" column by the "1st mth" column, subtracting 1, and then multiplying by 100.
To load daily gains for XIV, SPXU, VXX, and UPRO, 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.
A 4element list containing the following: (1) A character vector named
holdings
indicating what fund was held each day (XIV/SPXU, VXX/UPRO, or
cash); (2) a numeric vector named port.gains
giving the portfolio gain
for each day, which will be 0 for days that cash was held and the weighted
XIV/SPXU or VXX/UPRO gain for days that one of those positions was held; (3) a
numeric vector named port.balances
giving the portfolio balance each day;
and (4) a numeric value named trades
giving the total number of trades
that were executed.
NA
Dane R. Van Domelen
1. Jeffrey A. Ryan (2016). quantmod: Quantitative Financial Modelling Framework. R package version 0.46, https://cran.rproject.org/package=quantmod.
Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE0940903.
1 
Loading required package: rbenchmark
[1] NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.