pub struct AtmTracker { /* private fields */ }Expand description
Tracks the raw ATM price reactively from the forward price in option greeks.
Does not interact with cache — receives updates via handler callbacks.
Closest-strike resolution is delegated to StrikeRange::resolve().
Implementations§
Source§impl AtmTracker
impl AtmTracker
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new AtmTracker.
Sourcepub fn set_forward_precision(&mut self, precision: u8)
pub fn set_forward_precision(&mut self, precision: u8)
Sets the precision used when converting forward prices from f64 to Price.
Sourcepub fn set_initial_price(&mut self, price: Price)
pub fn set_initial_price(&mut self, price: Price)
Sets the initial ATM price (e.g. from a forward price fetched via HTTP).
This allows instant bootstrap without waiting for the first WebSocket tick. Subsequent live updates will overwrite this value normally.
Sourcepub fn update_from_option_greeks(&mut self, greeks: &OptionGreeks) -> bool
pub fn update_from_option_greeks(&mut self, greeks: &OptionGreeks) -> bool
Updates from an option greeks event.
Extracts underlying_price from the greeks — the exchange-provided
forward price for this expiry. Returns true if the ATM price was updated.
Sourcepub fn try_update_from_option_greeks(
&mut self,
greeks: &OptionGreeks,
) -> CorrectnessResult<bool>
pub fn try_update_from_option_greeks( &mut self, greeks: &OptionGreeks, ) -> CorrectnessResult<bool>
Updates from an option greeks event with correctness checking.
§Errors
Returns an error if the exchange-provided forward price is outside the
representable [Price] range.
Trait Implementations§
Source§impl Debug for AtmTracker
impl Debug for AtmTracker
Auto Trait Implementations§
impl Freeze for AtmTracker
impl RefUnwindSafe for AtmTracker
impl Send for AtmTracker
impl Sync for AtmTracker
impl Unpin for AtmTracker
impl UnsafeUnpin for AtmTracker
impl UnwindSafe for AtmTracker
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more