
Filter option rows by moneyness, delta windows and quality flags
Source:R/qmoms_utils.R
filter_options.Rd
Mirrors the Python helper: removes in-the-money quotes and rows outside delta windows; optionally enforces open interest / bid / min price.
Arguments
- optdata
A data frame with columns
mnes
, optionaldelta
, and optionallyopen_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
.
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>