nautilus_model/events/order/
mod.rsuse nautilus_core::{nanos::UnixNanos, uuid::UUID4};
use ustr::Ustr;
use crate::{
enums::{
ContingencyType, LiquiditySide, OrderSide, OrderType, TimeInForce, TrailingOffsetType,
TriggerType,
},
identifiers::{
AccountId, ClientOrderId, ExecAlgorithmId, InstrumentId, OrderListId, PositionId,
StrategyId, TradeId, TraderId, VenueOrderId,
},
types::{currency::Currency, money::Money, price::Price, quantity::Quantity},
};
pub mod accepted;
pub mod any;
pub mod cancel_rejected;
pub mod canceled;
pub mod denied;
pub mod emulated;
pub mod expired;
pub mod filled;
pub mod initialized;
pub mod modify_rejected;
pub mod pending_cancel;
pub mod pending_update;
pub mod rejected;
pub mod released;
pub mod snapshot;
pub mod submitted;
pub mod triggered;
pub mod updated;
#[cfg(feature = "stubs")]
pub mod stubs;
pub use crate::events::order::{
accepted::OrderAccepted, any::OrderEventAny, cancel_rejected::OrderCancelRejected,
canceled::OrderCanceled, denied::OrderDenied, emulated::OrderEmulated, expired::OrderExpired,
filled::OrderFilled, initialized::OrderInitialized, modify_rejected::OrderModifyRejected,
pending_cancel::OrderPendingCancel, pending_update::OrderPendingUpdate,
rejected::OrderRejected, released::OrderReleased, snapshot::OrderSnapshot,
submitted::OrderSubmitted, triggered::OrderTriggered, updated::OrderUpdated,
};
#[derive(Debug, PartialEq, Eq)]
pub enum OrderEventType {
Initialized,
Denied,
Emulated,
Released,
Submitted,
Accepted,
Rejected,
Canceled,
Expired,
Triggered,
PendingUpdate,
PendingCancel,
ModifyRejected,
CancelRejected,
Updated,
PartiallyFilled,
Filled,
}
pub trait OrderEvent: 'static + Send {
fn id(&self) -> UUID4;
fn kind(&self) -> &str;
fn order_type(&self) -> Option<OrderType>;
fn order_side(&self) -> Option<OrderSide>;
fn trader_id(&self) -> TraderId;
fn strategy_id(&self) -> StrategyId;
fn instrument_id(&self) -> InstrumentId;
fn trade_id(&self) -> Option<TradeId>;
fn currency(&self) -> Option<Currency>;
fn client_order_id(&self) -> ClientOrderId;
fn reason(&self) -> Option<Ustr>;
fn quantity(&self) -> Option<Quantity>;
fn time_in_force(&self) -> Option<TimeInForce>;
fn liquidity_side(&self) -> Option<LiquiditySide>;
fn post_only(&self) -> Option<bool>;
fn reduce_only(&self) -> Option<bool>;
fn quote_quantity(&self) -> Option<bool>;
fn reconciliation(&self) -> bool;
fn price(&self) -> Option<Price>;
fn last_px(&self) -> Option<Price>;
fn last_qty(&self) -> Option<Quantity>;
fn trigger_price(&self) -> Option<Price>;
fn trigger_type(&self) -> Option<TriggerType>;
fn limit_offset(&self) -> Option<Price>;
fn trailing_offset(&self) -> Option<Price>;
fn trailing_offset_type(&self) -> Option<TrailingOffsetType>;
fn expire_time(&self) -> Option<UnixNanos>;
fn display_qty(&self) -> Option<Quantity>;
fn emulation_trigger(&self) -> Option<TriggerType>;
fn trigger_instrument_id(&self) -> Option<InstrumentId>;
fn contingency_type(&self) -> Option<ContingencyType>;
fn order_list_id(&self) -> Option<OrderListId>;
fn linked_order_ids(&self) -> Option<Vec<ClientOrderId>>;
fn parent_order_id(&self) -> Option<ClientOrderId>;
fn exec_algorithm_id(&self) -> Option<ExecAlgorithmId>;
fn exec_spawn_id(&self) -> Option<ClientOrderId>;
fn venue_order_id(&self) -> Option<VenueOrderId>;
fn account_id(&self) -> Option<AccountId>;
fn position_id(&self) -> Option<PositionId>;
fn commission(&self) -> Option<Money>;
fn ts_event(&self) -> UnixNanos;
fn ts_init(&self) -> UnixNanos;
}