Skip to contents

Mirrors the Python helper: removes in-the-money quotes and rows outside delta windows; optionally enforces open interest / bid / min price.

Usage

filter_options(optdata, filter)

Arguments

optdata

A data frame with columns mnes, optional delta, and optionally open_interest, best_bid, best_offer, prem.

filter

A list with bounds (see rq_default_params()$filter), e.g. mnes_lim, delta_put_lim, delta_call_lim, open_int_zero, best_bid_zero, min_price.

Value

A filtered data frame (sorted by id, date, mnes if present).

Examples

# keep only OTM & within delta windows
head(filter_options(qmoms_surface, rq_default_params()$filter))
#> # A tibble: 0 × 7
#> # ℹ 7 variables: id <int>, date <date>, days <int>, mnes <dbl>, prem <dbl>,
#> #   impl_volatility <dbl>, delta <dbl>