#[non_exhaustive]pub struct VolSurfaceConfig {
pub min_usable_strikes: usize,
pub good_strike_count: usize,
pub max_iv_spread_filter: f64,
}Available on crate feature
vol-surface only.Expand description
Configuration for vol-surface construction.
Controls quality filtering and tier thresholds when building a VolSmile
from raw observations. Construct via VolSurfaceConfig::default for
sensible defaults, or via VolSurfaceConfig::builder for selective
overrides:
use black_76::vol_surface::VolSurfaceConfig;
let config = VolSurfaceConfig::builder()
.min_usable_strikes(2)
.good_strike_count(7)
.max_iv_spread_filter(0.30)
.build();
assert_eq!(config.min_usable_strikes, 2);New fields may be added in future minor versions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.min_usable_strikes: usizeMinimum usable strikes per expiry to interpolate (below this, falls back to flat ATM vol).
good_strike_count: usizeStrike count at or above which the smile is rated SmileQuality::Good.
max_iv_spread_filter: f64Maximum IV bid-ask spread to retain a strike. Strikes with wider spread are excluded from the smile.
Implementations§
Source§impl VolSurfaceConfig
impl VolSurfaceConfig
Sourcepub fn builder() -> VolSurfaceConfigBuilder
pub fn builder() -> VolSurfaceConfigBuilder
Returns a fresh builder seeded with the default config.
Trait Implementations§
Source§impl Clone for VolSurfaceConfig
impl Clone for VolSurfaceConfig
Source§fn clone(&self) -> VolSurfaceConfig
fn clone(&self) -> VolSurfaceConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VolSurfaceConfig
impl Debug for VolSurfaceConfig
Source§impl Default for VolSurfaceConfig
impl Default for VolSurfaceConfig
Source§impl<'de> Deserialize<'de> for VolSurfaceConfigwhere
VolSurfaceConfig: Default,
impl<'de> Deserialize<'de> for VolSurfaceConfigwhere
VolSurfaceConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VolSurfaceConfig
impl PartialEq for VolSurfaceConfig
Source§fn eq(&self, other: &VolSurfaceConfig) -> bool
fn eq(&self, other: &VolSurfaceConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for VolSurfaceConfig
impl Serialize for VolSurfaceConfig
impl StructuralPartialEq for VolSurfaceConfig
Auto Trait Implementations§
impl Freeze for VolSurfaceConfig
impl RefUnwindSafe for VolSurfaceConfig
impl Send for VolSurfaceConfig
impl Sync for VolSurfaceConfig
impl Unpin for VolSurfaceConfig
impl UnsafeUnpin for VolSurfaceConfig
impl UnwindSafe for VolSurfaceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more