Skip to main content

OrderExecutionData

Struct OrderExecutionData 

Source
pub struct OrderExecutionData {
Show 33 fields pub message_type: Option<String>, pub order_status: Option<String>, pub execution_type: Option<String>, pub order_quantity: Option<Decimal>, pub executed_quantity: Option<Decimal>, pub last_quantity: Option<Decimal>, pub remained_quantity: Option<Decimal>, pub ticker: Option<String>, pub class_code: Option<String>, pub side: Option<String>, pub order_type: Option<String>, pub average_price: Option<Decimal>, pub order_id: Option<String>, pub execution_id: Option<String>, pub price: Option<Decimal>, pub currency: Option<String>, pub client_code: Option<String>, pub transaction_time: Option<DateTime<Utc>>, pub order_number: Option<String>, pub accrued_coupon: Option<Decimal>, pub execution_value: Option<Decimal>, pub commission: Option<Decimal>, pub security_exchange: Option<String>, pub reject_reason: Option<String>, pub time_in_force: Option<i32>, pub expiry_date: Option<String>, pub stop_price: Option<Decimal>, pub take_price: Option<Decimal>, pub visible: Option<i64>, pub spread: Option<Decimal>, pub spread_type: Option<i32>, pub offset: Option<Decimal>, pub offset_type: Option<i32>,
}
Expand description

One report about an order: its state, quantities and the last fill.

This is the REST form. The WebSocket form is crate::ws::models::OrderExecutionData, which has typed enums instead of text. Numbers of quantity are in pieces. Status and type codes are text digits: status 0 new, 1 partly filled, 2 filled, 4 cancelled, 5 replaced, 6 cancel pending, 8 rejected, 9 replace pending, 10 waiting for confirmation. Side 1 buy, 2 sell. Order type 1 market, 2 limit, 3 algorithmic, 4 iceberg, 5 conditional.

§Examples

use brokapi_bcs_protocol::http::models::OrderStateListResponse;

let state: OrderStateListResponse = serde_json::from_str(
    r#"{"clientOrderId":"r-1","originalClientOrderId":"o-1","data":[
        {"orderStatus":"1","executionType":"1","orderQuantity":10,"executedQuantity":4,
         "remainedQuantity":6,"ticker":"SBER","classCode":"TQBR","side":"1","orderType":"2","price":300.0}]}"#,
)?;
let report = &state.data[0];
assert_eq!(report.order_status.as_deref(), Some("1")); // partly filled
assert_eq!(report.remained_quantity, Some(dec!(6.0)));

Fields§

§message_type: Option<String>

Type of the message, as text.

§order_status: Option<String>

State of the order, a digit as text (see the struct docs).

§execution_type: Option<String>

Type of the report, a digit as text: 0 new, 1 partial fill, 2 fill, 4 cancelled, 5 replaced, 6 cancel pending, 8 rejected, 9 suspended, 10 waiting for confirmation, 11 trade, 12 order status, 13 corrected.

§order_quantity: Option<Decimal>

Quantity of the order, in pieces.

§executed_quantity: Option<Decimal>

Executed quantity, in pieces.

§last_quantity: Option<Decimal>

Quantity of the latest fill, in pieces.

§remained_quantity: Option<Decimal>

Remaining quantity, in pieces.

§ticker: Option<String>

Ticker.

§class_code: Option<String>

Class code (board).

§side: Option<String>

1 buy, 2 sell.

§order_type: Option<String>

Type of the order, a digit as text (see the struct docs).

§average_price: Option<Decimal>

Average execution price. For repo and spread deals, the price of the first part.

§order_id: Option<String>

Id of the order at the exchange.

§execution_id: Option<String>

Id of the trade (fill).

§price: Option<Decimal>

Price of the order.

§currency: Option<String>

Currency.

§client_code: Option<String>

Client code.

§transaction_time: Option<DateTime<Utc>>

Time of the transaction (UTC). None if absent or the epoch.

§order_number: Option<String>

Order number.

§accrued_coupon: Option<Decimal>

Accrued coupon income.

§execution_value: Option<Decimal>

Volume of the trade.

§commission: Option<Decimal>

Commission.

§security_exchange: Option<String>

Exchange id.

§reject_reason: Option<String>

Why the order was rejected, when its status is 8.

§time_in_force: Option<i32>

Time in force: 1 Day, 2 Fill Or Kill, 3 Good Till Date. Shown for market, limit and algorithmic orders.

§expiry_date: Option<String>

End date YYYYMMDD, shown when time_in_force is 3.

§stop_price: Option<Decimal>

Stop price of a conditional order.

§take_price: Option<Decimal>

Take-profit price of a conditional order.

§visible: Option<i64>

Shown quantity of an iceberg order.

§spread: Option<Decimal>

Protective spread of a conditional order.

§spread_type: Option<i32>

Unit of spread: 0 price currency, 1 percent.

§offset: Option<Decimal>

Offset of a conditional order.

§offset_type: Option<i32>

Unit of offset: 0 price currency, 1 percent.

Trait Implementations§

Source§

impl Clone for OrderExecutionData

Source§

fn clone(&self) -> OrderExecutionData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrderExecutionData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OrderExecutionData

Source§

fn default() -> OrderExecutionData

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OrderExecutionData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more