View source: R/req_sec_def_opt_params.R
req_sec_def_opt_params | R Documentation |
Use this function to request the strike prices and expiry dates for options
that are available for a specified underlying contract. While the same
information could be obtained via req_contract_details(),
req_sec_def_opt_param
() is not subject to data pacing (throttling) and
is optimized for retreiving strike prices & expiry dates.
req_sec_def_opt_params(
underlyingSymbol = "",
futFopExchange = "",
underlyingSecType = "",
underlyingConId = "",
channel = NULL
)
underlyingSymbol |
Character, length 1. Symbol of the underlying contract, e.g., "AAPL". |
futFopExchange |
Character, length 1. Exchange where fetched options trade, e.g., "NASDAQOM" |
underlyingSecType |
Character, length 1. The type of the underlying security. See SecType in the contract documentation. |
underlyingConId |
Character or numeric, length 1. The |
channel |
One of the following:
|
A 1-row tibble with the following columns:
exchange <chr>: See contract
underlyingConId <numeric>: Unique numeric conId
of
underlying contract; See contract
tradingClass <chr>: See contract
multiplier <numeric>: See contract
expirations <list of POSIXt Date Objects>: Expiry dates of
put & call options traded on exchange
for the contract whose
conId
is passed as argument underlyingConId
expirations <list of Numeric Objects>: Strike prices of put
& call options traded on exchange
for the contract whose
conId
is passed as argument underlyingConId
Other asset info:
req_contract_details()
,
req_matching_symbols()
# Query Option Parameters for IBM Stock
ibm_opt_params <- req_sec_def_opt_params(
underlyingSymbol = "IBM",
underlyingSecType = "STK",
underlyingConId = 8314
)
# Print the params:
ibm_opt_params
# Print just the strike prices:
ibm_opt_params$strikes
# median strike price:
median(ibm_opt_params$strikes[[1]])
# Print just the expirations:
ibm_opt_params$expirations
# Find latest expiration:
max(ibm_opt_params$expirations[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.