addOptions: Build Options Dataset

Description Usage Arguments Details Value See Also

View source: R/options.R

Description

This function is the creator for an S3 class of structured dataset on options.

Usage

1
2
addOptions(stocksData, optionNames = NULL, underlyingNames, Date = NULL,
  impVol, strike, moneyness, callput, maturity)

Arguments

stocksData

a stocksData object, the stocks dataset that contains underlying information.

optionNames

a character vector, the symbols of the options.

underlyingNames

a character vector of the same length as optionNames, which specifies the underlying of each option.

Date

a Date vector, which specifies the dates of options data.

impVol

the implied volatility of each option for each date.

strike, moneyness

a numerical vector that specifies the strike or moneyness of the options.

callput

a character vector which can either take "call" or "put".

maturity

time to maturity of the options.

Details

This function builds an options dataset by organizing raw options data and underlying stocks data into a structured form. If optionsNames==NULL, the options will be automatically named as "OP1", "OP2", and so on. If Date==NULL, the options data is regarded as in reverse chronological order with the same dates as in stocksData.

Value

An object of class optionsData, which stores the structured data of options and stocks.

See Also

stocks for building stocksData objects.


zhangkd5/riskCalc documentation built on May 4, 2019, 10:16 p.m.