FinancialInstrument (version 1.3.1)

option_series.yahoo: constructor for series of options using yahoo data

Description

Defines a chain or several chains of options by looking up necessary info from yahoo.

Usage

option_series.yahoo(symbol, Exp, currency = "USD", multiplier = 100,
  first_traded = NULL, tick_size = NULL, overwrite = TRUE)

Arguments

symbol

character vector of ticker symbols of the underlying instruments (Currently, should only be stock tickers)

Exp

Expiration date or dates to be passed to getOptionChain

currency

currency of underlying and options

multiplier

contract multiplier. Usually 100 for stock options

first_traded

first date that contracts are tradeable. Probably not applicable if defining several chains.

tick_size

minimum price change of options.

overwrite

if an instrument already exists, should it be overwritten?

Value

Called for side-effect. The instrument that is created and stored will inherit option_series, option, and instrument classes.

Details

If Exp is missing it will define only the nearby options. If Exp is NULL it will define all options

If first_traded and/or tick_size should not be the same for all options being defined, they should be left NULL and defined outside of this function.

References

Yahoo https://finance.yahoo.com

See Also

option_series, option, instrument, getOptionChain

Examples

Run this code
# NOT RUN {
option_series.yahoo('SPY') #only nearby calls and puts
option_series.yahoo('DIA', Exp=NULL) #all chains
ls_instruments()
# }

Run the code above in your browser using DataLab