powered by
Defines a chain or several chains of options by looking up necessary info from yahoo.
option_series.yahoo(symbol, Exp, currency = "USD", multiplier = 100, first_traded = NULL, tick_size = NULL, overwrite = TRUE)
character vector of ticker symbols of the underlying instruments (Currently, should only be stock tickers)
Expiration date or dates to be passed to getOptionChain
currency of underlying and options
contract multiplier. Usually 100 for stock options
first date that contracts are tradeable. Probably not applicable if defining several chains.
minimum price change of options.
if an instrument already exists, should it be overwritten?
Called for side-effect. The instrument that is created and stored will inherit option_series, option, and instrument classes.
If Exp is missing it will define only the nearby options. If Exp is NULL it will define all options
Exp
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.
first_traded
tick_size
Yahoo https://finance.yahoo.com
option_series, option, instrument, getOptionChain
option_series
option
instrument
getOptionChain
# 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