A Look at VIX :2020-03-24

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.

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
## 4079 03/17/2020    82.69    84.83   70.37     75.91 2020-03-17
## 4080 03/18/2020    69.37    85.47   69.37     76.45 2020-03-18
## 4081 03/19/2020    80.62    84.26   68.57     72.00 2020-03-19
## 4082 03/20/2020    67.86    69.51   57.42     66.04 2020-03-20
## 4083 03/23/2020    74.08    76.74   60.46     61.59 2020-03-23
## 4084 03/24/2020    58.76    61.88   36.24     61.67 2020-03-24

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