pub struct OptionChainSlice {
pub series_id: OptionSeriesId,
pub atm_strike: Option<Price>,
pub calls: BTreeMap<Price, OptionStrikeData>,
pub puts: BTreeMap<Price, OptionStrikeData>,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
}Expand description
A point-in-time snapshot of an option chain for a single series.
Fields§
§series_id: OptionSeriesIdThe option series identifier.
atm_strike: Option<Price>The current ATM strike price (if determined).
calls: BTreeMap<Price, OptionStrikeData>Call option data keyed by strike price (sorted).
puts: BTreeMap<Price, OptionStrikeData>Put option data keyed by strike price (sorted).
ts_event: UnixNanosUNIX timestamp (nanoseconds) when the snapshot event occurred.
ts_init: UnixNanosUNIX timestamp (nanoseconds) when the instance was initialized.
Implementations§
Source§impl OptionChainSlice
impl OptionChainSlice
Sourcepub fn new(series_id: OptionSeriesId) -> Self
pub fn new(series_id: OptionSeriesId) -> Self
Creates a new empty OptionChainSlice for the given series.
Sourcepub fn call_count(&self) -> usize
pub fn call_count(&self) -> usize
Returns the number of call entries.
Sourcepub fn get_call(&self, strike: &Price) -> Option<&OptionStrikeData>
pub fn get_call(&self, strike: &Price) -> Option<&OptionStrikeData>
Returns the call data for a given strike price.
Sourcepub fn get_put(&self, strike: &Price) -> Option<&OptionStrikeData>
pub fn get_put(&self, strike: &Price) -> Option<&OptionStrikeData>
Returns the put data for a given strike price.
Sourcepub fn get_call_quote(&self, strike: &Price) -> Option<&QuoteTick>
pub fn get_call_quote(&self, strike: &Price) -> Option<&QuoteTick>
Returns the call quote for a given strike price.
Sourcepub fn get_call_greeks(&self, strike: &Price) -> Option<&OptionGreeks>
pub fn get_call_greeks(&self, strike: &Price) -> Option<&OptionGreeks>
Returns the call Greeks for a given strike price.
Sourcepub fn get_put_quote(&self, strike: &Price) -> Option<&QuoteTick>
pub fn get_put_quote(&self, strike: &Price) -> Option<&QuoteTick>
Returns the put quote for a given strike price.
Sourcepub fn get_put_greeks(&self, strike: &Price) -> Option<&OptionGreeks>
pub fn get_put_greeks(&self, strike: &Price) -> Option<&OptionGreeks>
Returns the put Greeks for a given strike price.
Sourcepub fn strikes(&self) -> Vec<Price>
pub fn strikes(&self) -> Vec<Price>
Returns all strike prices present in the chain (union of calls and puts).
Sourcepub fn strike_count(&self) -> usize
pub fn strike_count(&self) -> usize
Returns the total number of unique strikes.
Trait Implementations§
Source§impl Clone for OptionChainSlice
impl Clone for OptionChainSlice
Source§fn clone(&self) -> OptionChainSlice
fn clone(&self) -> OptionChainSlice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more