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: Venue
The venue for the matching engine.
instrument: InstrumentAny
The instrument for the matching engine.
raw_id: u32
The instruments raw integer ID for the venue.
book_type: BookType
The order book type for the matching engine.
oms_type: OmsType
The order management system (OMS) type for the matching engine.
account_type: AccountType
The account type for the matching engine.
market_status: MarketStatus
The market status for the matching engine.
config: OrderMatchingEngineConfig
The config for the matching engine.
core: OrderMatchingCore
Implementations§
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: &'static AtomicTime, msgbus: Rc<RefCell<MessageBus>>, 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, )
pub fn process_query_order(&self, command: &QueryOrder, 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
§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