pub struct OrderMatchingEngine {
pub venue: Venue,
pub instrument: InstrumentAny,
pub raw_id: u32,
pub book_type: BookType,
pub oms_type: OmsType,
pub account_type: AccountType,
pub market_status: MarketStatus,
pub config: OrderMatchingEngineConfig,
pub core: OrderMatchingCore,
/* private fields */
}Expand description
An order matching engine for a single market.
Fields§
§venue: VenueThe venue for the matching engine.
instrument: InstrumentAnyThe instrument for the matching engine.
raw_id: u32The instruments raw integer ID for the venue.
book_type: BookTypeThe order book type for the matching engine.
oms_type: OmsTypeThe order management system (OMS) type for the matching engine.
account_type: AccountTypeThe account type for the matching engine.
market_status: MarketStatusThe market status for the matching engine.
config: OrderMatchingEngineConfigThe config for the matching engine.
core: OrderMatchingCoreImplementations§
Source§impl OrderMatchingEngine
impl OrderMatchingEngine
pub fn new( instrument: InstrumentAny, raw_id: u32, fill_model: FillModel, fee_model: FeeModelAny, book_type: BookType, oms_type: OmsType, account_type: AccountType, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, config: OrderMatchingEngineConfig, ) -> Self
pub fn reset(&mut self)
pub const fn set_fill_model(&mut self, fill_model: FillModel)
pub fn best_bid_price(&self) -> Option<Price>
pub fn best_ask_price(&self) -> Option<Price>
pub const fn get_book(&self) -> &OrderBook
pub fn get_open_bid_orders(&self) -> &[PassiveOrderAny]
pub fn get_open_ask_orders(&self) -> &[PassiveOrderAny]
pub fn get_open_orders(&self) -> Vec<PassiveOrderAny>
pub fn order_exists(&self, client_order_id: ClientOrderId) -> bool
Sourcepub fn process_order_book_delta(&mut self, delta: &OrderBookDelta)
pub fn process_order_book_delta(&mut self, delta: &OrderBookDelta)
Process the venues market for the given order book delta.
pub fn process_order_book_deltas(&mut self, deltas: &OrderBookDeltas)
pub fn process_quote_tick(&mut self, quote: &QuoteTick)
pub fn process_bar(&mut self, bar: &Bar)
pub fn process_trade_tick(&mut self, trade: &TradeTick)
pub fn process_status(&mut self, action: MarketStatusAction)
pub fn process_order(&mut self, order: &mut OrderAny, account_id: AccountId)
pub fn process_modify(&mut self, command: &ModifyOrder, account_id: AccountId)
pub fn process_cancel(&mut self, command: &CancelOrder, account_id: AccountId)
pub fn process_cancel_all( &mut self, command: &CancelAllOrders, account_id: AccountId, )
pub fn process_batch_cancel( &mut self, command: &BatchCancelOrders, account_id: AccountId, )
Sourcepub fn iterate(&mut self, timestamp_ns: UnixNanos)
pub fn iterate(&mut self, timestamp_ns: UnixNanos)
Iterate the matching engine by processing the bid and ask order sides
and advancing time up to the given UNIX timestamp_ns.
pub fn fill_market_order(&mut self, order: &mut OrderAny)
pub fn fill_limit_order(&mut self, order: &mut OrderAny)
pub fn trigger_stop_order(&mut self, order: &mut OrderAny)
Auto Trait Implementations§
impl Freeze for OrderMatchingEngine
impl !RefUnwindSafe for OrderMatchingEngine
impl !Send for OrderMatchingEngine
impl !Sync for OrderMatchingEngine
impl Unpin for OrderMatchingEngine
impl !UnwindSafe for OrderMatchingEngine
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