The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Optionstrat

John T. Buynak

2019-12-03

Package Info

The optionstrat package provides full functionality for analyzing option greeks and option strategies. All option analytics are calculated using the Black-Scholes-Merton option pricing model.

1. Option Greek Calculations

The following functions may be used to calculate all of the option greeks as well as the option premium and provide the information in a data.frame format:

Alternatively, these functions will return a specific option greek:

Arguments:

Additionally:

Arguments:

2. Plot Option Strategies

The following functions may be used to plot specific option strategies:

Arguments:

Additional plotting function:

Arguments:

Additional plotting function:

Arguments:

3. Vertical Spread Analytics

Vertical Spread Analytics

This function calculates the key analytics of a vertical spread and returns the ouput as a data.frame:

Arguments:

Details:

Double Vertical Credit Spread Analytics

This function calculates the key analytics of a double vertical credit spread and returns the output as a data.frame:

Arguments:

4. Probability Functions

The “Probability Below” function has two separate possible operations:

  1. Calculates the probability of the underlying asset value remaining below a price level in a designated time frame, given the daily standard devaiation of the underlying returns.
  2. Calculates the price the asset will remain below, given the designated probability

Arguments:

The “Probability Above” function has two separate possible operations:

  1. Calculates the probability of the underlying asset value remaining above a price level in a designated time frame, given the daily standard devaiation of the underlying returns.
  2. Calculates the price the asset will remain above, given the designated probability

Arguments:

The “Probability Between”

This function has two separate possible operations:

  1. Calculates the probability of the underlying asset value falling between two prices in a designated time frame, given the daily standard devaiation of the underlying returns.
  2. Calculates the probable price range, given a set probability

Arguments:

5. Auxiliary Functions

The optionstrat package provides additional functions for calculating the implied volatility of either a call or put option, numerical time differences, and converting a nominal rate into a continuously compounded rate.

Implied Volatility:

iv.calc(type, price, s, x, t, r, d=0)

When applying this function over the rows of a dataframe, run it iteratively:

for(i in 1:nrow(dataframe)){ dataframe$iv[i] <- iv.calc(type = "put", price = dataframe$putprice[i], s = atm, x = dataframe$strike[i], t = ttm, r = rate) }

Arguments:

Numerical Time Difference:

Continuously Compounded Rate Conversion:

Arguments:

Disclaimer

The optionstrat package is provided free of charge to the general public. The indicators, strategies, calculations, functions and all other features are for educational purposes only and should not be construed as investment advice.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.