| schwab_optionChain | R Documentation |
Search an Option Chain for a specific ticker
schwab_optionChain(
ticker,
strikes,
inclQuote = TRUE,
startDate = Sys.Date() + 1,
endDate = Sys.Date() + 360,
contractType = c("ALL", "CALL", "PUT"),
accessTokenList = NULL,
range = NULL
)
ticker |
underlying ticker for the options chain |
strikes |
the number of strikes above and below the current strike |
inclQuote |
set TRUE to include pricing details (will be delayed if account is set for delayed quotes) |
startDate |
the start date for expiration (should be greater than or equal to today). Format: yyyy-mm-dd |
endDate |
the end date for expiration (should be greater than or equal to today). Format: yyyy-mm-dd |
contractType |
can be 'ALL', 'CALL', or 'PUT' |
accessTokenList |
A valid Access Token must be set using the output from
|
range |
Also known as moneyness. Popular choices are: 'OTM', 'ITM', 'NTM', or 'ALL'. CAVEAT: the 'strikes' parameter must be left out otherwise the Schwab API will take the 'strikes' parameter and override the range parameter There's also 'SAK', 'SBK', and 'SNK' for strikes above/below/near market |
Return a list containing two data frames. The first is the underlying data for the symbol. The second item in the list is a data frame that contains the options chain for the specified ticker.
a list of 2 data frames - underlying and options chain
## Not run:
# Pull all option contracts expiring over the next 6 months
# with 5 strikes above and below the at-the-money price
schwab_optionChain(ticker = 'SPY',
strikes = 5,
endDate = Sys.Date() + 180)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.