pub struct KylesLambdaCalculator { /* private fields */ }Expand description
Kyle’s Lambda calculator for market impact coefficient
Kyle’s Lambda (λ) measures the price impact per unit of net order flow. Formula: λ = Δp / Δq where Δp is the price change and Δq is the net volume imbalance
Implementations§
Source§impl KylesLambdaCalculator
impl KylesLambdaCalculator
Sourcepub fn new(window_size: usize, interval_duration_ms: u64) -> Self
pub fn new(window_size: usize, interval_duration_ms: u64) -> Self
Create a new Kyle’s Lambda calculator
§Arguments
window_size- Number of intervals to use for rolling calculationinterval_duration_ms- Duration of each interval in milliseconds
Sourcepub fn update_trade(&mut self, trade: &TradeTick) -> Option<f64>
pub fn update_trade(&mut self, trade: &TradeTick) -> Option<f64>
Update with a new trade
Sourcepub fn add_trade(&mut self, trade: &TradeTick)
pub fn add_trade(&mut self, trade: &TradeTick)
Alias for update_trade() to maintain backward compatibility
Sourcepub fn get_lambda(&self) -> Option<f64>
pub fn get_lambda(&self) -> Option<f64>
Get current Kyle’s Lambda estimate
Trait Implementations§
Source§impl Clone for KylesLambdaCalculator
impl Clone for KylesLambdaCalculator
Source§fn clone(&self) -> KylesLambdaCalculator
fn clone(&self) -> KylesLambdaCalculator
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KylesLambdaCalculator
impl RefUnwindSafe for KylesLambdaCalculator
impl Send for KylesLambdaCalculator
impl Sync for KylesLambdaCalculator
impl Unpin for KylesLambdaCalculator
impl UnwindSafe for KylesLambdaCalculator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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