pub struct OrderEmulator { /* private fields */ }Implementations§
Source§impl OrderEmulator
impl OrderEmulator
pub fn new(clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>) -> Self
pub fn register_msgbus_handlers(emulator: &Rc<RefCell<Self>>)
pub fn set_on_event_handler(&mut self, handler: TypedHandler<OrderEventAny>)
Sourcepub fn cache_submit_order_command(&mut self, command: SubmitOrder)
pub fn cache_submit_order_command(&mut self, command: SubmitOrder)
Caches a submit order command for emulation tracking.
pub fn subscribed_quotes(&self) -> Vec<InstrumentId>
pub fn subscribed_trades(&self) -> Vec<InstrumentId>
pub fn subscribed_strategy_count(&self) -> usize
pub fn monitored_position_count(&self) -> usize
pub fn get_submit_order_commands(&self) -> AHashMap<ClientOrderId, SubmitOrder>
pub fn get_matching_core( &self, instrument_id: &InstrumentId, ) -> Option<OrderMatchingCore>
pub fn start(&mut self)
pub fn stop(&self)
pub fn reset(&mut self)
pub fn dispose(&mut self)
pub fn on_event(&mut self, event: &OrderEventAny)
pub const fn on_stop(&self)
pub fn on_reset(&mut self)
pub fn on_dispose(&mut self)
pub fn execute(&mut self, command: TradingCommand)
Sourcepub fn handle_submit_order(&mut self, command: &SubmitOrder)
pub fn handle_submit_order(&mut self, command: &SubmitOrder)
§Panics
Panics if the emulation trigger type is NoTrigger or if order not in cache.
pub fn handle_cancel_order(&mut self, command: CancelOrder)
pub fn update_order(&mut self, order: &mut OrderAny, new_quantity: Quantity)
pub fn on_order_book_deltas(&mut self, deltas: &OrderBookDeltas)
pub fn on_quote_tick(&mut self, quote: QuoteTick)
pub fn on_trade_tick(&mut self, trade: TradeTick)
pub fn cancel_order(&mut self, order: &OrderAny)
Sourcepub fn trigger_stop_order(&mut self, client_order_id: ClientOrderId)
pub fn trigger_stop_order(&mut self, client_order_id: ClientOrderId)
§Panics
Panics if the order type is invalid for a stop order.
Sourcepub fn fill_limit_order(&mut self, client_order_id: ClientOrderId)
pub fn fill_limit_order(&mut self, client_order_id: ClientOrderId)
§Panics
Panics if a limit order has no price.
Sourcepub fn fill_market_order(&mut self, client_order_id: ClientOrderId)
pub fn fill_market_order(&mut self, client_order_id: ClientOrderId)
§Panics
Panics if a market order command is missing.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OrderEmulator
impl !Send for OrderEmulator
impl !Sync for OrderEmulator
impl !UnwindSafe for OrderEmulator
impl Freeze for OrderEmulator
impl Unpin for OrderEmulator
impl UnsafeUnpin for OrderEmulator
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