option_series.yahoo {FinancialInstrument} | R Documentation |
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? |
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.
Value
Called for side-effect. The instrument that is created and stored will inherit option_series, option, and instrument classes.
Note
Has only been tested with stock options. The options' currency should be the same as the underlying's.
Author(s)
Garrett See
References
Yahoo https://finance.yahoo.com
See Also
option_series
, option
,
instrument
, getOptionChain
Examples
## Not run:
option_series.yahoo('SPY') #only nearby calls and puts
option_series.yahoo('DIA', Exp=NULL) #all chains
ls_instruments()
## End(Not run)