#[non_exhaustive]pub enum StrikeRange {
Fixed(Vec<Price>),
AtmRelative {
strikes_above: usize,
strikes_below: usize,
},
AtmPercent {
pct: f64,
},
Delta {
target: f64,
tolerance: f64,
},
}Expand description
Defines which strikes to include in an option chain subscription.
Existing variants support direct construction. Downstream matches require a
wildcard arm so new selection modes can be added without changing those matches.
Use Self::resolve for model-level selection, or reject unsupported modes
explicitly when implementing a custom selector.
An exhaustive match outside this crate does not compile:
use nautilus_model::data::StrikeRange;
fn is_fixed(range: &StrikeRange) -> bool {
match range {
StrikeRange::Fixed(_) => true,
StrikeRange::AtmRelative { .. } => false,
StrikeRange::AtmPercent { .. } => false,
StrikeRange::Delta { .. } => false,
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fixed(Vec<Price>)
Subscribe to a fixed set of strike prices.
AtmRelative
Subscribe to strikes relative to ATM: N strikes above and N below.
AtmPercent
Subscribe to strikes within a percentage band around ATM price.
Delta
Subscribe to strikes whose absolute option delta is near target.
Delta resolution needs Greeks, so the option chain aggregator performs it.
The model-level StrikeRange::resolve has no Greeks and falls back to an
ATM-relative window of DEFAULT_DELTA_FALLBACK_STRIKES strikes either side
of ATM until Greeks are available.
Implementations§
Source§impl StrikeRange
impl StrikeRange
Sourcepub fn resolve(
&self,
atm_price: Option<Price>,
all_strikes: &[Price],
) -> Vec<Price>
pub fn resolve( &self, atm_price: Option<Price>, all_strikes: &[Price], ) -> Vec<Price>
Resolves the filtered set of strikes from all available strikes.
Fixed: returns the fixed strikes directly (intersected with available).AtmRelative: finds the closest strike to ATM, takes N above and N below.AtmPercent: filters strikes within a percentage band around ATM.Delta: has no Greeks at this level, so it falls back to an ATM-relative window ofDEFAULT_DELTA_FALLBACK_STRIKESstrikes either side of ATM. The option chain aggregator resolvesDeltafrom Greeks instead.
If atm_price is None for ATM-based variants, returns an empty vec
(subscriptions are deferred until ATM is known).