pub struct OrderStatusReport {Show 32 fields
pub account_id: AccountId,
pub instrument_id: InstrumentId,
pub client_order_id: Option<ClientOrderId>,
pub venue_order_id: VenueOrderId,
pub order_side: OrderSide,
pub order_type: OrderType,
pub time_in_force: TimeInForce,
pub order_status: OrderStatus,
pub quantity: Quantity,
pub filled_qty: Quantity,
pub report_id: UUID4,
pub ts_accepted: UnixNanos,
pub ts_last: UnixNanos,
pub ts_init: UnixNanos,
pub order_list_id: Option<OrderListId>,
pub venue_position_id: Option<PositionId>,
pub linked_order_ids: Option<Vec<ClientOrderId>>,
pub parent_order_id: Option<ClientOrderId>,
pub contingency_type: ContingencyType,
pub expire_time: Option<UnixNanos>,
pub price: Option<Price>,
pub trigger_price: Option<Price>,
pub trigger_type: Option<TriggerType>,
pub limit_offset: Option<Decimal>,
pub trailing_offset: Option<Decimal>,
pub trailing_offset_type: TrailingOffsetType,
pub avg_px: Option<Decimal>,
pub display_qty: Option<Quantity>,
pub post_only: bool,
pub reduce_only: bool,
pub cancel_reason: Option<String>,
pub ts_triggered: Option<UnixNanos>,
}Expand description
Represents an order status at a point in time.
Fields§
§account_id: AccountIdThe account ID associated with the position.
instrument_id: InstrumentIdThe instrument ID associated with the event.
client_order_id: Option<ClientOrderId>The client order ID.
venue_order_id: VenueOrderIdThe venue assigned order ID.
order_side: OrderSideThe order side.
order_type: OrderTypeThe order type.
time_in_force: TimeInForceThe order time in force.
order_status: OrderStatusThe order status.
quantity: QuantityThe order quantity.
filled_qty: QuantityThe order total filled quantity.
report_id: UUID4The unique identifier for the event.
ts_accepted: UnixNanosUNIX timestamp (nanoseconds) when the order was accepted.
ts_last: UnixNanosUNIX timestamp (nanoseconds) when the last event occurred.
ts_init: UnixNanosUNIX timestamp (nanoseconds) when the event was initialized.
order_list_id: Option<OrderListId>The order list ID associated with the order.
venue_position_id: Option<PositionId>The position ID associated with the order (assigned by the venue).
linked_order_ids: Option<Vec<ClientOrderId>>The reported linked client order IDs related to contingency orders.
parent_order_id: Option<ClientOrderId>The parent order ID for contingent child orders, if available.
contingency_type: ContingencyTypeThe orders contingency type.
expire_time: Option<UnixNanos>The order expiration (UNIX epoch nanoseconds), zero for no expiration.
price: Option<Price>The order price (LIMIT).
trigger_price: Option<Price>The order trigger price (STOP).
trigger_type: Option<TriggerType>The trigger type for the order.
limit_offset: Option<Decimal>The trailing offset for the orders limit price.
trailing_offset: Option<Decimal>The trailing offset for the orders trigger price (STOP).
trailing_offset_type: TrailingOffsetTypeThe trailing offset type.
avg_px: Option<Decimal>The order average fill price.
display_qty: Option<Quantity>The quantity of the LIMIT order to display on the public book (iceberg).
post_only: boolIf the order will only provide liquidity (make a market).
reduce_only: boolIf the order carries the ‘reduce-only’ execution instruction.
cancel_reason: Option<String>The reason for order cancellation.
ts_triggered: Option<UnixNanos>UNIX timestamp (nanoseconds) when the order was triggered.
Implementations§
Source§impl OrderStatusReport
impl OrderStatusReport
Sourcepub fn new(
account_id: AccountId,
instrument_id: InstrumentId,
client_order_id: Option<ClientOrderId>,
venue_order_id: VenueOrderId,
order_side: OrderSide,
order_type: OrderType,
time_in_force: TimeInForce,
order_status: OrderStatus,
quantity: Quantity,
filled_qty: Quantity,
ts_accepted: UnixNanos,
ts_last: UnixNanos,
ts_init: UnixNanos,
report_id: Option<UUID4>,
) -> Self
pub fn new( account_id: AccountId, instrument_id: InstrumentId, client_order_id: Option<ClientOrderId>, venue_order_id: VenueOrderId, order_side: OrderSide, order_type: OrderType, time_in_force: TimeInForce, order_status: OrderStatus, quantity: Quantity, filled_qty: Quantity, ts_accepted: UnixNanos, ts_last: UnixNanos, ts_init: UnixNanos, report_id: Option<UUID4>, ) -> Self
Creates a new OrderStatusReport instance with required fields.
Sourcepub const fn with_client_order_id(self, client_order_id: ClientOrderId) -> Self
pub const fn with_client_order_id(self, client_order_id: ClientOrderId) -> Self
Sets the client order ID.
Sourcepub const fn with_order_list_id(self, order_list_id: OrderListId) -> Self
pub const fn with_order_list_id(self, order_list_id: OrderListId) -> Self
Sets the order list ID.
Sourcepub fn with_linked_order_ids(
self,
linked_order_ids: impl IntoIterator<Item = ClientOrderId>,
) -> Self
pub fn with_linked_order_ids( self, linked_order_ids: impl IntoIterator<Item = ClientOrderId>, ) -> Self
Sets the linked client order IDs.
Sourcepub const fn with_parent_order_id(self, parent_order_id: ClientOrderId) -> Self
pub const fn with_parent_order_id(self, parent_order_id: ClientOrderId) -> Self
Sets the parent order ID.
Sourcepub const fn with_venue_position_id(self, venue_position_id: PositionId) -> Self
pub const fn with_venue_position_id(self, venue_position_id: PositionId) -> Self
Sets the venue position ID.
Sourcepub const fn with_price(self, price: Price) -> Self
pub const fn with_price(self, price: Price) -> Self
Sets the price.
Sourcepub fn with_avg_px(self, avg_px: f64) -> Result<Self>
pub fn with_avg_px(self, avg_px: f64) -> Result<Self>
Sourcepub const fn with_trigger_price(self, trigger_price: Price) -> Self
pub const fn with_trigger_price(self, trigger_price: Price) -> Self
Sets the trigger price.
Sourcepub const fn with_trigger_type(self, trigger_type: TriggerType) -> Self
pub const fn with_trigger_type(self, trigger_type: TriggerType) -> Self
Sets the trigger type.
Sourcepub const fn with_limit_offset(self, limit_offset: Decimal) -> Self
pub const fn with_limit_offset(self, limit_offset: Decimal) -> Self
Sets the limit offset.
Sourcepub const fn with_trailing_offset(self, trailing_offset: Decimal) -> Self
pub const fn with_trailing_offset(self, trailing_offset: Decimal) -> Self
Sets the trailing offset.
Sourcepub const fn with_trailing_offset_type(
self,
trailing_offset_type: TrailingOffsetType,
) -> Self
pub const fn with_trailing_offset_type( self, trailing_offset_type: TrailingOffsetType, ) -> Self
Sets the trailing offset type.
Sourcepub const fn with_display_qty(self, display_qty: Quantity) -> Self
pub const fn with_display_qty(self, display_qty: Quantity) -> Self
Sets the display quantity.
Sourcepub const fn with_expire_time(self, expire_time: UnixNanos) -> Self
pub const fn with_expire_time(self, expire_time: UnixNanos) -> Self
Sets the expire time.
Sourcepub const fn with_post_only(self, post_only: bool) -> Self
pub const fn with_post_only(self, post_only: bool) -> Self
Sets post_only flag.
Sourcepub const fn with_reduce_only(self, reduce_only: bool) -> Self
pub const fn with_reduce_only(self, reduce_only: bool) -> Self
Sets reduce_only flag.
Sourcepub fn with_cancel_reason(self, cancel_reason: String) -> Self
pub fn with_cancel_reason(self, cancel_reason: String) -> Self
Sets cancel reason.
Sourcepub const fn with_ts_triggered(self, ts_triggered: UnixNanos) -> Self
pub const fn with_ts_triggered(self, ts_triggered: UnixNanos) -> Self
Sets the triggered timestamp.
Sourcepub const fn with_contingency_type(
self,
contingency_type: ContingencyType,
) -> Self
pub const fn with_contingency_type( self, contingency_type: ContingencyType, ) -> Self
Sets the contingency type.
Sourcepub fn is_order_updated(&self, order: &impl Order) -> bool
pub fn is_order_updated(&self, order: &impl Order) -> bool
Returns whether the order has been updated based on this report.
An order is considered updated if any of the following differ:
- Price (if both the order and report have a price).
- Trigger price (if both the order and report have a trigger price).
- Quantity.
Trait Implementations§
Source§impl CatalogPathPrefix for OrderStatusReport
impl CatalogPathPrefix for OrderStatusReport
Source§fn path_prefix() -> &'static str
fn path_prefix() -> &'static str
Source§impl Clone for OrderStatusReport
impl Clone for OrderStatusReport
Source§fn clone(&self) -> OrderStatusReport
fn clone(&self) -> OrderStatusReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderStatusReport
impl Debug for OrderStatusReport
Source§impl<'de> Deserialize<'de> for OrderStatusReport
impl<'de> Deserialize<'de> for OrderStatusReport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OrderStatusReport
impl Display for OrderStatusReport
Source§impl HasTsInit for OrderStatusReport
impl HasTsInit for OrderStatusReport
Source§impl PartialEq for OrderStatusReport
impl PartialEq for OrderStatusReport
Source§fn eq(&self, other: &OrderStatusReport) -> bool
fn eq(&self, other: &OrderStatusReport) -> bool
self and other values to be equal, and is used by ==.