pub struct FillModel { /* private fields */ }
Implementations§
Source§impl FillModel
impl FillModel
Sourcepub fn new(
prob_fill_on_limit: f64,
prob_fill_on_stop: f64,
prob_slippage: f64,
random_seed: Option<u64>,
) -> Result<Self>
pub fn new( prob_fill_on_limit: f64, prob_fill_on_stop: 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_stop_filled(&mut self) -> bool
pub fn is_stop_filled(&mut self) -> bool
Returns true
if a stop 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,
§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 moreSource§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
Adds separators according to the given
SeparatorPolicy
. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Inserts a comma every three digits from the right. Read more
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Inserts a space every three digits from the right. Read more
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Inserts a period every three digits from the right. Read more
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Inserts an underscore every three digits from the right. Read more