<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/which-implied-volatility-ratio-is-best/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://quantstrattrader.wordpress.com/2018/01/24/which-implied-volatility-ratio-is-best/"> R – QuantStrat TradeR</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>This post will be about comparing a volatility signal using three different variations of implied volatility indices to predict when to enter a short volatility position.</p>
<p>In volatility trading, there are three separate implied volatility indices that have a somewhat long history for trading–the VIX (everyone knows this one), the VXV (more recently changed to be called the VIX3M), which is like the VIX, except for a three-month period), and the VXMT, which is the implied six-month volatility period.</p>
<p>This relationship gives investigation into three separate implied volatility ratios: VIX/VIX3M (aka VXV), VIX/VXMT, and VIX3M/VXMT, as predictors for entering a short (or long) volatility position.</p>
<p>So, let’s get the data.</p>
<pre>
require(downloader)
require(quantmod)
require(PerformanceAnalytics)
require(TTR)
require(data.table)

download(&quot;http://www.cboe.com/publish/scheduledtask/mktdata/datahouse/vix3mdailyprices.csv&quot;, 
         destfile=&quot;vxvData.csv&quot;)
download(&quot;http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/vxmtdailyprices.csv&quot;, 
         destfile=&quot;vxmtData.csv&quot;)

VIX &lt;- fread(&quot;http://www.cboe.com/publish/scheduledtask/mktdata/datahouse/vixcurrent.csv&quot;, skip = 1)
VIXdates &lt;- VIX$Date
VIX$Date &lt;- NULL; VIX &lt;- xts(VIX, order.by=as.Date(VIXdates, format = '%m/%d/%Y'))


vxv &lt;- xts(read.zoo(&quot;vxvData.csv&quot;, header=TRUE, sep=&quot;,&quot;, format=&quot;%m/%d/%Y&quot;, skip=2))
vxmt &lt;- xts(read.zoo(&quot;vxmtData.csv&quot;, header=TRUE, sep=&quot;,&quot;, format=&quot;%m/%d/%Y&quot;, skip=2))

download(&quot;https://dl.dropboxusercontent.com/s/jk6der1s5lxtcfy/XIVlong.TXT&quot;,
         destfile=&quot;longXIV.txt&quot;)

xiv &lt;- xts(read.zoo(&quot;longXIV.txt&quot;, format=&quot;%Y-%m-%d&quot;, sep=&quot;,&quot;, header=TRUE))

xivRets &lt;- Return.calculate(Cl(xiv))
</pre>
<p>One quick strategy to investigate is simple–the idea that the ratio should be below 1 (I.E. contango in implied volatility term structure) and decreasing (below a moving average). So when the ratio will be below 1 (that is, with longer-term implied volatility greater than shorter-term), and the ratio will be below its 60-day moving average, the strategy will take a position in XIV.</p>
<p>Here’s the code to do that.</p>
<pre>
stratStats
function(rets) {
  stats &lt;- rbind(table.AnnualizedReturns(rets), maxDrawdown(rets))
  stats[5,] &lt;- stats[1,]/stats[4,]
  stats[6,] &lt;- stats[1,]/UlcerIndex(rets)
  rownames(stats)[4] &lt;- &quot;Worst Drawdown&quot;
  rownames(stats)[5] &lt;- &quot;Calmar Ratio&quot;
  rownames(stats)[6] &lt;- &quot;Ulcer Performance Index&quot;
  return(stats)
}

maShort &lt;- SMA(vixVix3m, 60)
maMed &lt;- SMA(vixVxmt, 60)
maLong &lt;- SMA(vix3mVxmt, 60)

sigShort &lt;- vixVix3m &lt; 1 &amp; vixVix3m &lt; maShort
sigMed &lt;- vixVxmt &lt; 1 &amp; vixVxmt &lt; maMed 
sigLong &lt;- vix3mVxmt &lt; 1 &amp; vix3mVxmt &lt; maLong 

retsShort &lt;- lag(sigShort, 2) * xivRets 
retsMed &lt;- lag(sigMed, 2) * xivRets 
retsLong &lt;- lag(sigLong, 2) * xivRets

compare &lt;- na.omit(cbind(retsShort, retsMed, retsLong))
colnames(compare) &lt;- c(&quot;Short&quot;, &quot;Medium&quot;, &quot;Long&quot;)
charts.PerformanceSummary(compare)
stratStats(compare)

</pre>
<p>With the following performance:</p>
<p><img data-orig-file="https://quantstrattrader.files.wordpress.com/2018/01/3ratios.png?w=456" data-orig-size="905,547" data-medium-file="https://quantstrattrader.files.wordpress.com/2018/01/3ratios.png?w=456?w=300" data-attachment-id="1540" data-image-meta="{" data-image-description="" src="https://quantstrattrader.files.wordpress.com/2018/01/3ratios.png?w=456" data-permalink="https://quantstrattrader.wordpress.com/2018/01/24/which-implied-volatility-ratio-is-best/3ratios/#main" data-large-file="https://quantstrattrader.files.wordpress.com/2018/01/3ratios.png?w=456?w=640" alt="3ratios.PNG" data-image-title="3ratios" sizes="(max-width: 640px) 100vw, 640px" data-comments-opened="1" class="wp-image-1540" data-recalc-dims="1"></p>
<pre>
> stratStats(compare)
                              Short    Medium     Long
Annualized Return         0.5485000 0.6315000 0.638600
Annualized Std Dev        0.3874000 0.3799000 0.378900
Annualized Sharpe (Rf=0%) 1.4157000 1.6626000 1.685600
Worst Drawdown            0.5246983 0.5318472 0.335756
Calmar Ratio              1.0453627 1.1873711 1.901976
Ulcer Performance Index   3.7893478 4.6181788 5.244137
</pre>
<p>In other words, the VIX3M/VXMT sports the lowest drawdowns (by a large margin) with higher returns.</p>
<p>So, when people talk about which implied volatility ratio to use, I think this offers some strong evidence for the longer-out horizon as a predictor for which implied vol term structure to use. It’s also why it forms the basis of my <a rel="nofollow" href="https://www.patreon.com/quantstrattrader" target="_blank">subscription strategy</a>.</p>
<p>Thanks for reading.</p>
<p>NOTE: I am currently seeking a full-time position (remote or in the northeast U.S.) related to my skill set demonstrated on this blog. Please <a rel="nofollow" href="https://www.linkedin.com/in/ilyakipnis/" target="_blank">message me on LinkedIn</a> if you know of any opportunities which may benefit from my skill set.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://quantstrattrader.wordpress.com/2018/01/24/which-implied-volatility-ratio-is-best/"> R – QuantStrat TradeR</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/ohcDvP8Cqjk" height="1"></a></div>