Skip to main content

StochasticMatcher

Struct StochasticMatcher 

Source
pub struct StochasticMatcher { /* private fields */ }

Implementations§

Source§

impl StochasticMatcher

Source

pub fn new(dt: f64, k: f64, a: f64) -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_rng(self, rng: StdRng) -> Self

Seed this matcher with an explicit RNG (for reproducible, Send-safe copies).

Source

pub fn effective_a(&self) -> f64

Current effective arrival rate (base + Hawkes excitation).

Source

pub fn hawkes_excitation(&self) -> f64

Current Hawkes excitation level (0 when disabled or quiescent).

Source

pub fn effective_a_buy(&self) -> f64

Current effective buy-side arrival rate in bilateral mode.

Source

pub fn effective_a_sell(&self) -> f64

Current effective sell-side arrival rate in bilateral mode.

Trait Implementations§

Source§

impl Matcher for StochasticMatcher

Source§

fn add_order(&mut self, order: Order)

Adds a new order to the matcher
Source§

fn cancel_order(&mut self, order_id: u64)

Cancels a specific order by ID
Source§

fn cancel_all(&mut self)

Cancels all open orders
Source§

fn process_quote(&mut self, state: &MarketState) -> Vec<FillEvent>

Processes a new quote against open orders and returns any fill events
Source§

fn get_orders(&self) -> &Vec<Order>

Returns a reference to the current list of orders
Source§

fn augment_parameters(&self) -> HashMap<String, f64>

Returns runtime state parameters to be injected into each tick’s MarketState before strategies are called. The default returns an empty map; override in matchers that carry observable state (e.g. Hawkes intensity).

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V