pub struct QuoteCache { /* private fields */ }Expand description
Quote cache that accumulates IB tick updates to build complete quotes.
Interactive Brokers sends individual tick price and size updates (bid price, ask price, bid size, ask size). This cache accumulates these updates until we have a complete quote with both bid and ask sides.
Implementations§
Source§impl QuoteCache
impl QuoteCache
Sourcepub fn update_bid_price(
&mut self,
instrument_id: InstrumentId,
price: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Option<QuoteTick>
pub fn update_bid_price( &mut self, instrument_id: InstrumentId, price: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Option<QuoteTick>
Update bid price and return a complete quote if available.
Sourcepub fn update_ask_price(
&mut self,
instrument_id: InstrumentId,
price: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Option<QuoteTick>
pub fn update_ask_price( &mut self, instrument_id: InstrumentId, price: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Option<QuoteTick>
Update ask price and return a complete quote if available.
Sourcepub fn update_bid_size(
&mut self,
instrument_id: InstrumentId,
size: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Option<QuoteTick>
pub fn update_bid_size( &mut self, instrument_id: InstrumentId, size: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Option<QuoteTick>
Update bid size and return a complete quote if available.
Sourcepub fn update_bid_size_with_filter(
&mut self,
instrument_id: InstrumentId,
size: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
ignore_size_only: bool,
) -> Option<QuoteTick>
pub fn update_bid_size_with_filter( &mut self, instrument_id: InstrumentId, size: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ignore_size_only: bool, ) -> Option<QuoteTick>
Update bid size and return a complete quote if available, with optional filtering.
Sourcepub fn update_ask_size(
&mut self,
instrument_id: InstrumentId,
size: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Option<QuoteTick>
pub fn update_ask_size( &mut self, instrument_id: InstrumentId, size: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Option<QuoteTick>
Update ask size and return a complete quote if available.
Sourcepub fn update_ask_size_with_filter(
&mut self,
instrument_id: InstrumentId,
size: f64,
price_precision: u8,
size_precision: u8,
ts_event: UnixNanos,
ts_init: UnixNanos,
ignore_size_only: bool,
) -> Option<QuoteTick>
pub fn update_ask_size_with_filter( &mut self, instrument_id: InstrumentId, size: f64, price_precision: u8, size_precision: u8, ts_event: UnixNanos, ts_init: UnixNanos, ignore_size_only: bool, ) -> Option<QuoteTick>
Update ask size and return a complete quote if available, with optional filtering.
Sourcepub fn get_last_quote(&self, instrument_id: &InstrumentId) -> Option<&QuoteTick>
pub fn get_last_quote(&self, instrument_id: &InstrumentId) -> Option<&QuoteTick>
Get the last complete quote for an instrument (if available).
Trait Implementations§
Source§impl Debug for QuoteCache
impl Debug for QuoteCache
Source§impl Default for QuoteCache
impl Default for QuoteCache
Source§fn default() -> QuoteCache
fn default() -> QuoteCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QuoteCache
impl RefUnwindSafe for QuoteCache
impl Send for QuoteCache
impl Sync for QuoteCache
impl Unpin for QuoteCache
impl UnsafeUnpin for QuoteCache
impl UnwindSafe for QuoteCache
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
§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>
Converts
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>
Converts
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