pub struct OrderTypeTracker { /* private fields */ }Expand description
Order Type Tracker for limit/market order ratios
Tracks market aggressiveness via order type ratios.
Warning: Order type inference from trade data is inherently unreliable since most exchanges don’t provide order type information in their trade feeds. This tracker should be used for statistical analysis only, not for critical trading decisions.
Implementations§
Source§impl OrderTypeTracker
impl OrderTypeTracker
Sourcepub fn limit_to_market_ratio(&self) -> Option<Decimal>
pub fn limit_to_market_ratio(&self) -> Option<Decimal>
Calculate limit to market order ratio
Sourcepub fn market_aggressiveness(&self) -> Decimal
pub fn market_aggressiveness(&self) -> Decimal
Calculate market aggressiveness (market orders / total known orders)
Note: This calculation excludes unknown orders since their type cannot be determined. Only considers orders classified as either limit or market.
Sourcepub const fn get_counts(&self) -> (u64, u64, u64)
pub const fn get_counts(&self) -> (u64, u64, u64)
Get order counts (limit, market, unknown)
Sourcepub const fn get_known_counts(&self) -> (u64, u64)
pub const fn get_known_counts(&self) -> (u64, u64)
Get only limit and market order counts for backward compatibility
Sourcepub const fn unknown_count(&self) -> u64
pub const fn unknown_count(&self) -> u64
Get the number of unknown orders
Sourcepub const fn total_count(&self) -> u64
pub const fn total_count(&self) -> u64
Get the total number of orders (including unknown)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrderTypeTracker
impl RefUnwindSafe for OrderTypeTracker
impl Send for OrderTypeTracker
impl Sync for OrderTypeTracker
impl Unpin for OrderTypeTracker
impl UnwindSafe for OrderTypeTracker
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
§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