Learn R Programming

alphavantagepf (version 0.3.2)

av_grep_opts: Extract data from Alpha Vantage returned data

Description

Extract data from Alpha Vantage returned data

Usage

av_grep_opts(
  indta,
  grepstring = "F,M,call",
  mindays = 3,
  startdt = Sys.Date(),
  deltarange = c(0.1, 0.55)
)

Value

A reduced set of options obtained from av_get_pf() using Alphavantage HISTORICAL_OPTIONS function.

Arguments

indta

A data.table as returned by av_get_pf()

grepstring

(default F,M,call) Three item string to select maturities and option types from indta. Each item is an abbreviated code for what to select.

  • How far out to go: F for first contract (e.g. front week), B for second/back contract, anything else for all contracts.

  • Maturity Schedule: M for monthly contracts, Q for quarterly contract, anythign else for weekly contracts.

  • Option Type: call, put, or all

mindays

(default 3). Minimum number of days to expiration to be passed through from startdt

startdt

(default Sys.Date()). Date from which expirations will be considered.

deltarange

(default c(0.1,0.55)) Two number list with minimum and maximum absolute valued deltas to pass through.

Details

av_get_pf() returns a large list of options. This function helps to narrow down the list by maturity and moneyness.

See Also

av_get_pf()

Examples

Run this code
if (FALSE) {
av_get_pf("IBM","HISTORICAL_OPTIONS") |> av_grep_opts("F,M,put",mindays=2)
}

Run the code above in your browser using DataLab