Description Usage Arguments Author(s) References Examples
Given a dataframe with the columns
1) strike # the option strike - in $
2) type # either c for call option or p for a put option
3) optionPrice # the option price - in $
4) futurePrice # the price of the underlying future - in $
5) time_to_expiry
plotImpliedVol() plots the Implied Volatility across Call & Put options and option time to expiry.
Risk Free Rate r is taken from 3-Month US T-Bills of the specified date argument
1 | plotImpliedVol(df, date="2019-09-18", mode="B")
|
df |
Data Frame with 5 columns: |
date |
Date of option data ("character" in format "yyyy-mm-dd" including quotes) |
mode |
Specify plots based on different mode types |
Jason Yip
https://www.glynholton.com/notes/black_1976/
1 2 3 4 5 6 7 8 9 10 11 | df = data.frame(
strike = c(50, 23, 48, 24, 52, 20,51,22,49),
type = c("C","P","C","P","C","P","C","P","C"),
optionPrice = c(1.62,0.01,1.62,0.01,1.62,0.01,1.5,0.02,1.7),
futurePrice = c(48.03, 48.03,48.03, 48.03,48.03, 48.03, 48.03, 48.03, 48.03),
time_to_expiry = c(0.1423, 0.1423,0.1323, 0.1323,0.1223, 0.1223, 0.12, 0.11, 0.15))
plotImpliedVol(df, date="2018-09-18", mode="B")
plotImpliedVol(df, date="2018-09-18", mode="C")
plotImpliedVol(df, date="2018-09-18", mode="P")
plotImpliedVol(df, date="2018-09-18", mode="CP")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.