pub struct MarketHoursFillModel { /* private fields */ }Expand description
Fill model that simulates varying conditions based on market hours. During low liquidity: wider spreads (one tick worse). Normal hours: standard liquidity.
Implementations§
Source§impl MarketHoursFillModel
impl MarketHoursFillModel
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>
Creates a new MarketHoursFillModel instance.
§Errors
Returns an error if probability parameters are not in range [0, 1].
pub fn set_low_liquidity_period(&mut self, is_low_liquidity: bool)
pub fn is_low_liquidity_period(&self) -> bool
Trait Implementations§
Source§impl Clone for MarketHoursFillModel
impl Clone for MarketHoursFillModel
Source§impl Debug for MarketHoursFillModel
impl Debug for MarketHoursFillModel
Source§impl Default for MarketHoursFillModel
impl Default for MarketHoursFillModel
Source§impl FillModel for MarketHoursFillModel
impl FillModel for MarketHoursFillModel
Source§fn is_limit_filled(&mut self) -> bool
fn is_limit_filled(&mut self) -> bool
Returns
true if a limit order should be filled based on the model.Source§fn is_slipped(&mut self) -> bool
fn is_slipped(&mut self) -> bool
Returns
true if an order fill should slip by one tick.Source§fn get_orderbook_for_fill_simulation(
&mut self,
instrument: &InstrumentAny,
_order: &OrderAny,
best_bid: Price,
best_ask: Price,
) -> Option<OrderBook>
fn get_orderbook_for_fill_simulation( &mut self, instrument: &InstrumentAny, _order: &OrderAny, best_bid: Price, best_ask: Price, ) -> Option<OrderBook>
Returns a simulated
OrderBook for fill simulation. Read moreAuto Trait Implementations§
impl Freeze for MarketHoursFillModel
impl RefUnwindSafe for MarketHoursFillModel
impl Send for MarketHoursFillModel
impl Sync for MarketHoursFillModel
impl Unpin for MarketHoursFillModel
impl UnsafeUnpin for MarketHoursFillModel
impl UnwindSafe for MarketHoursFillModel
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