av_grep_opts: Extract data from Alpha Vantage returned data

View source: R/av_extract_opts.R

av_grep_optsR Documentation

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)
)

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.

Value

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

See Also

av_get_pf()

Examples

## Not run: 
av_get_pf("IBM","HISTORICAL_OPTIONS") |> av_grep_opts("F,M,put",mindays=2)

## End(Not run)


alphavantagepf documentation built on Jan. 23, 2026, 1:06 a.m.