A Look at VIX :2020-05-01

Get Some VIX data

NB: I originally wrote this on February 27, 2020 so there is commentary surrounding that date. It was done on the quick for curiosity. I will update it by recompiling it with new data and will update the commentary noting when it took place.

Chicago Board Of Exchange (CBOE) makes data available regularly. To judge the currency of the data, I have tailed it below after converting the dates to a valid date format.

library(tidyverse)
VIX <- read.csv(url("http://www.cboe.com/publish/scheduledtask/mktdata/datahouse/vixcurrent.csv"), skip = 1)
VIX$Dates <- as.Date(VIX$Date,
  format = "%m/%d/%Y")
tail(VIX)
##            Date VIX.Open VIX.High VIX.Low VIX.Close      Dates
## 4106 04/24/2020    41.91    42.08   35.60     35.93 2020-04-24
## 4107 04/27/2020    36.29    36.44   32.51     33.29 2020-04-27
## 4108 04/28/2020    33.21    35.39   30.54     33.57 2020-04-28
## 4109 04/29/2020    32.48    33.19   30.71     31.23 2020-04-29
## 4110 04/30/2020    30.99    35.94   30.93     34.15 2020-04-30
## 4111 05/01/2020    38.17    39.57   36.59     37.19 2020-05-01

The data was straightforward to get a hold of. Now let me plot it. I want to do this with a candlestick plot – a way of displaying intra-day volatility. There’s so much data that the views aren’t great.

library(plotly)
# create the candlestick plot
fig <- VIX  %>% plot_ly(x = ~Dates, type="candlestick",
          open = ~VIX.Open, close = ~VIX.Close,
          high = ~VIX.High, low = ~VIX.Low) 
fig <- fig %>% layout(title = "A Historical Look at VIX")
library(widgetframe)
# Need a frameWidget to render the underlying plotly object
frameWidget(fig, width = 1000)

As an overall it has been worse, but keep in mind, that big blip happened TODAY! What does it look like in perspective [keeping in mind that the futures are currently just under 40] since 2012?

fig2 <- VIX %>% filter(Dates > as.Date("01/01/2012", format = "%m/%d/%Y")) %>% plot_ly(x = ~Dates, type="candlestick",
          open = ~VIX.Open, close = ~VIX.Close,
          high = ~VIX.High, low = ~VIX.Low) 
fig2 <- fig2 %>% layout(title = "VIX Since 2012")
frameWidget(fig2, width = 1000)

Day to Day Changes?

I will touch the file about daily to track the evolution.

library(hrbrthemes); library(viridis)
VIX <- VIX %>% mutate(Percent.Change = (VIX.Close - lag(VIX.Close)) / lag(VIX.Close)) 
p <- ggplot(VIX, aes(x=Dates, y=Percent.Change, size=Percent.Change/10, color=Percent.Change)) + 
  geom_point(alpha=0.5, shape=21, inherit.aes = TRUE) +
  scale_size_continuous(range=c(0.05,2), guide=FALSE) +
  geom_line() + 
  geom_smooth(color="orange", method="loess", span=0.05, se=FALSE) + 
  geom_vline(xintercept = as.Date("02/27/2020", format = "%m/%d/%Y"), color="red", alpha=0.2, linetype = "dotted") + 
  geom_vline(xintercept = as.Date("09/12/2008", format = "%m/%d/%Y"), color="red", alpha=0.4) +
  geom_label(data = data.frame(x = as.Date("2008-02-12"),
    y = 0.75, label = "Lehman Brothers"),mapping = aes(x = x, y = y, label = label), size = 3.86605783866058, angle = 0L, lineheight = 1L, hjust = 0.5, vjust = 0.5, colour = "red", family = "sans", fontface = "plain", label.padding = structure(0.25, class = "unit", valid.unit = 3L, unit = "lines"), label.size = 0.25, label.r = structure(0.15, class = "unit", valid.unit = 3L, unit = "lines"), inherit.aes = FALSE, show.legend = FALSE) + 
  scale_color_viridis_c(guide=FALSE) +
  scale_fill_viridis_c(guide=FALSE) +
    theme_ipsum()
fig <- ggplotly(p)
frameWidget(fig, width = 1000)

NB: This commentary was in mid-March. This doesn’t look good. The smooth on a small span is uncomfortably headed upward and today will shock it like no previous day in a very long while.

Avatar
Robert W. Walker
Associate Professor of Quantitative Methods

My research interests include causal inference, statistical computation and data visualisation.

Next
Previous