pub struct FillModel { /* private fields */ }Implementations§
Source§impl FillModel
impl FillModel
Sourcepub fn new(
prob_fill_on_limit: f64,
prob_slippage: f64,
random_seed: Option<u64>,
) -> Result<Self>
pub fn new( prob_fill_on_limit: f64, prob_slippage: f64, random_seed: Option<u64>, ) -> Result<Self>
Sourcepub fn is_limit_filled(&mut self) -> bool
pub fn is_limit_filled(&mut self) -> bool
Returns true if a limit order should be filled based on the configured probability.
Sourcepub fn is_slipped(&mut self) -> bool
pub fn is_slipped(&mut self) -> bool
Returns true if an order should slip by one tick based on the configured probability.
Sourcepub fn get_orderbook_for_fill_simulation(
&self,
_instrument: &dyn Any,
_order: &dyn Any,
_best_bid: f64,
_best_ask: f64,
) -> Option<Box<dyn Any>>
pub fn get_orderbook_for_fill_simulation( &self, _instrument: &dyn Any, _order: &dyn Any, _best_bid: f64, _best_ask: f64, ) -> Option<Box<dyn Any>>
Returns a simulated OrderBook for fill simulation.
This method allows custom fill models to provide their own liquidity
simulation by returning a custom OrderBook that represents the expected
market liquidity. The matching engine will use this simulated OrderBook
to determine fills.
The default implementation returns None, which means the matching engine will use its standard fill logic (maintaining backward compatibility).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FillModel
impl RefUnwindSafe for FillModel
impl Send for FillModel
impl Sync for FillModel
impl Unpin for FillModel
impl UnwindSafe for FillModel
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,
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