Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Download option prices of ticker VIX for all expiration dates and name it VIX Download the current price (last quote price) for VIX For calls

Download option prices of ticker VIX for all expiration dates and name it "VIX"

Download the current price (last quote price) for VIX

For calls and puts at each expiration, add a column of "Price", which is the average of "Bid" and "Ask"

For calls and puts at each expiration, add a column of "moneyness", which takes value TRUE when it is out-of-money, and FALSE otherwise. (A call option is out-of-money when its strike is greater than current price of underlying. A put option is out-of-money if its strike is less than current price of underlying. And the current price of underlying is from the second question)

I have gotten the first two parts of the question and an attaching my code below, but cannot figure out how to get the moneyness column added with values.

library(quantmod)

getSymbols(Symbols="^VIX")

VIX=data.frame(VIX)

head(VIX)

tail(VIX)

#1.2

getQuote("^VIX")

#1.3

vix_opt=getOptionChain("^VIX")

vix_optall=getOptionChain("^VIX", NULL)

names(vix_optall)

pricefunc <- function(x){

x$calls$Price <- 0.5*(x$calls$Bid + x$calls$Ask)

x$puts$Price <- 0.5*(x$puts$Bid + x$puts$Ask)

return(x)

}

vix_optall=lapply(vix_optall, pricefunc)

names(vix_optall$Nov.04.2020$puts)

head(vix_optall$Nov.04.2020$puts)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Investing

Authors: Scott B. Smart, Lawrence J. Gitman, Michael D. Joehnk

13th Edition

978-0134083308, 013408330X

More Books

Students also viewed these Finance questions

Question

Describe the characteristics of small business.

Answered: 1 week ago