Getting to Know Option Behavior

author: Matt Brigida, date: 10/06/2014

Answer the questions in your own markdown file and submit the html.

library(IBrokers)
library(quantmod)
tws <- twsConnect()

First we'll create stock and option objects for the SPY ETF. The option on SPY is a call expiring 10/31/2014 with a $196.50 strike.

spy <- twsEquity("SPY", "SMART")
spy.opt <- twsOption(local = '', expiry = '20141031', strike = '196.5', right = 'C', symbol = 'SPY')

Next we'll pull price data for both the stock and option at 5 minute intervals over the last 6 days.

spy.d <- reqHistoricalData(tws, spy, barSize="5 mins", duration="6 D")
## TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture 
## TWS Message: 2 -1 2104 Market data farm connection is OK:usopt 
## TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm 
## TWS Message: 2 -1 2106 HMDS data farm connection is OK:ilhmds 
## TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds 
## waiting for TWS reply on SPY .... done.
Sys.sleep(3)
spy.opt.d <- reqHistoricalData(tws, spy.opt, barSize="5 mins", duration="6 D")
## waiting for TWS reply on SPY .... done.
data.p <- merge(spy.d[,6], spy.opt.d[,6], join="inner")
names(data.p) <- c("stock", "option")

We'll convert the price data into arithmetic returns.

data.r <- xts(apply(data.p, 2, Delt)[-1,], order.by=index(data)[-1])

Here are plots of the absolute value of returns (volatility).

chartSeries(abs(data.r$stock))

plot of chunk unnamed-chunk-5

chartSeries(abs(data.r$option))

plot of chunk unnamed-chunk-5

What do you notice about the relative volatilities?

apply(data.r, 2, sd)
##     stock    option 
## 0.0008527 0.0304218

Do the same for some other option and underlying stock (the resulting charts should be in your html submission).

Consider the results of the following regressions.

Regression of the change in the option price on the change in the stock price.

summary(lm(diff(data.p$option)[-1] ~ diff(data.p$stock)[-1]))
## 
## Call:
## lm(formula = diff(data.p$option)[-1] ~ diff(data.p$stock)[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2970 -0.0263  0.0013  0.0280  0.5459 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -0.00095    0.00314    -0.3     0.76    
## diff(data.p$stock)[-1]  0.35166    0.01878    18.7   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0677 on 462 degrees of freedom
## Multiple R-squared:  0.432,  Adjusted R-squared:  0.43 
## F-statistic:  351 on 1 and 462 DF,  p-value: <2e-16

Regression of the percent change in the option price on the change in the stock price.

summary(lm(data.r$option ~ data.r$stock))
## 
## Call:
## lm(formula = data.r$option ~ data.r$stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.11415 -0.00916  0.00001  0.00934  0.19989 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.57e-04   1.11e-03    0.14     0.89    
## data.r$stock 2.21e+01   1.30e+00   16.95   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0239 on 462 degrees of freedom
## Multiple R-squared:  0.383,  Adjusted R-squared:  0.382 
## F-statistic:  287 on 1 and 462 DF,  p-value: <2e-16

Can you draw any conclusion from these regressions?