pub struct StochasticMatcher { /* private fields */ }Implementations§
Source§impl StochasticMatcher
impl StochasticMatcher
pub fn new(dt: f64, k: f64, a: f64) -> Self
Sourcepub fn with_hawkes(self, alpha: f64, beta: f64) -> Self
pub fn with_hawkes(self, alpha: f64, beta: f64) -> Self
Enable Hawkes self-excitation for fill arrivals.
Each fill boosts the effective arrival rate by alpha.
The boost decays exponentially at rate beta (per second).
The branching ratio alpha/beta must be < 1 for stationarity.
Sourcepub fn with_bilateral_hawkes(self, alpha: f64, beta: f64) -> Self
pub fn with_bilateral_hawkes(self, alpha: f64, beta: f64) -> Self
Enable bilateral (2D) Hawkes: separate intensities for buy and sell arrivals.
dλ+ = β(μ − λ+)dt + α dN+ (buy side, excited only by buy fills) dλ- = β(μ − λ-)dt + α dN- (sell side, excited only by sell fills)
where μ = a (the baseline rate), α = alpha, β = beta.
Branching ratio alpha/beta must be < 1 for stationarity.
Sourcepub fn with_initial_hawkes_intensity(self, lambda0: f64) -> Self
pub fn with_initial_hawkes_intensity(self, lambda0: f64) -> Self
Initialize unilateral Hawkes so effective intensity starts at lambda0.
Keeps baseline a unchanged and adjusts only the excitation state.
Sourcepub fn with_initial_bilateral_hawkes_intensities(
self,
lambda_buy0: f64,
lambda_sell0: f64,
) -> Self
pub fn with_initial_bilateral_hawkes_intensities( self, lambda_buy0: f64, lambda_sell0: f64, ) -> Self
Initialize bilateral Hawkes so buy/sell effective intensities start at
(lambda_buy0, lambda_sell0).
Keeps baseline a unchanged and adjusts only side-specific excitations.
Sourcepub fn with_rng(self, rng: StdRng) -> Self
pub fn with_rng(self, rng: StdRng) -> Self
Seed this matcher with an explicit RNG (for reproducible, Send-safe copies).
Sourcepub fn effective_a(&self) -> f64
pub fn effective_a(&self) -> f64
Current effective arrival rate (base + Hawkes excitation).
Sourcepub fn hawkes_excitation(&self) -> f64
pub fn hawkes_excitation(&self) -> f64
Current Hawkes excitation level (0 when disabled or quiescent).
Sourcepub fn effective_a_buy(&self) -> f64
pub fn effective_a_buy(&self) -> f64
Current effective buy-side arrival rate in bilateral mode.
Sourcepub fn effective_a_sell(&self) -> f64
pub fn effective_a_sell(&self) -> f64
Current effective sell-side arrival rate in bilateral mode.
Trait Implementations§
Source§impl Matcher for StochasticMatcher
impl Matcher for StochasticMatcher
Source§fn cancel_order(&mut self, order_id: u64)
fn cancel_order(&mut self, order_id: u64)
Source§fn cancel_all(&mut self)
fn cancel_all(&mut self)
Source§fn process_quote(&mut self, state: &MarketState) -> Vec<FillEvent>
fn process_quote(&mut self, state: &MarketState) -> Vec<FillEvent>
Source§fn get_orders(&self) -> &Vec<Order>
fn get_orders(&self) -> &Vec<Order>
Auto Trait Implementations§
impl Freeze for StochasticMatcher
impl RefUnwindSafe for StochasticMatcher
impl Send for StochasticMatcher
impl Sync for StochasticMatcher
impl Unpin for StochasticMatcher
impl UnsafeUnpin for StochasticMatcher
impl UnwindSafe for StochasticMatcher
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
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