knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This package utilizes functionality from the package "optionstrat" and "plotly" to produce a 3D graph plotting a selected option parameter over time for a double vertical option spread. The available parameters are the option premium or an option greek such as delta, gamma, vega, theta or rho. A double vertical option spread is an option strategy composed of 4 options of the same type (calls or puts) with different strike prices, the highest and lowest strike option are typically long while the middle two are short. The double vertical spread is also known as an "Iron Condor", or an "Iron Butterfly" if the middle two options have the same strike.
visualize((type = "call", parameter = "premium", s = 100, si = 100, x1 = 90, x2 = 95, x3 = 105, x4 = 110, v1 = 0.20, v2 = v1, v3 = v1, v4 = v1, ti = 45/365, r = 0.02, d = 0, ls = 1, low = 75, high = 125, e1 =(45/365), e2 = (30/365), e3 = (15/365), e4 = (1/365), c1 = 1, c2 = 1, c3 = 1, c4 = 1))
typeCharacter String: "call" or "put"
parameterCharacter String: "premium", "delta", "gamma", "vega", "theta", "rho"
sUnderlying Asset Price
siInitial Price of the underlying asset
x1Option 1 Strike
x2Option 2 Strike
x3Option 3 Strike
x4Option 4 Strike
v1Option 1 Volatility
v2Option 2 Volatility
v3Option 3 Volatility
v4Option 4 Volatility
tiInitial time to maturity in years
rAnnualized continuously compounded risk-free rate
dAnnualized continuously compounded dividend yield
lsNumerical either 1 or -1
lowLower Limit for the price range
highUpper Limit for the price range
e1Expiration, in years. Set to 45/365
e2Expiration, in years. Set to 30/365
e3Expiration, in years. Set to 15/365
e4Expiration, in years. Set to 1/365
c1Option 1, Number of Contracts
c2Option 2, Number of Contracts
c3Option 3, Number of Contracts
c4Option 4, Number of Contracts
This function produces a 3d Plot of the volatility skew any publicly traded corporation or index. It plots the implied volatility of option contracts of five expirations, the expirations used are the contracts closest to 5, 15, 25, 35 and 45 days to expiration. Only contracts with a strike between the current spot price multiplied by the lower limit and the upper limit will be used in the plot.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.