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
impl Clone for OrderExecutionData
Source§fn clone(&self) -> OrderExecutionData
fn clone(&self) -> OrderExecutionData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more