Skip to main content

OrderRecord

Struct OrderRecord 

Source
pub struct OrderRecord {
Show 30 fields pub order_id: String, pub order_num: Option<i64>, pub client_code: Option<String>, pub executed_value: Option<Decimal>, pub trade_date: Option<String>, pub order_date_time: Option<DateTime<Utc>>, pub update_date_time: Option<DateTime<Utc>>, pub ticker: Option<String>, pub class_code: Option<String>, pub side: Option<i32>, pub order_type: Option<i32>, pub order_status: Option<i32>, pub order_quantity: Option<Decimal>, pub executed_quantity: Option<Decimal>, pub price: Option<Decimal>, pub average_price: Option<Decimal>, pub remained_quantity: Option<Decimal>, pub order_quantity_lots: Option<Decimal>, pub remained_quantity_lots: Option<Decimal>, pub executed_quantity_lots: Option<Decimal>, pub settlement_currency: Option<String>, pub reject_reason: Option<String>, pub take_price: Option<Decimal>, pub stop_price: Option<Decimal>, pub linked_order: Option<String>, pub stop_order: Option<String>, pub market_take_profit: Option<i32>, pub market_stop_loss: Option<i32>, pub position_price_stop: Option<Decimal>, pub position_price_limit: Option<Decimal>,
}
Expand description

One order in the order list (POST .../orders/search).

This record is not the same as the order state of OrderExecutionData. It uses numbers for side, type and status, with the meaning of the list: status 1 cancelled, 2 executed, 3 active. It carries the broker’s order id and no clientOrderId. Quantities come in pieces and in lots.

§Examples

use brokapi_bcs_protocol::http::models::OrderRecord;

let r: OrderRecord = serde_json::from_str(
    r#"{"orderId":"20261019-TQBR-79000001","orderNum":79000001,"ticker":"SBER","classCode":"TQBR",
        "side":1,"orderType":2,"orderStatus":3,"price":300.0,"orderQuantity":1,"remainedQuantity":1,
        "orderDateTime":"2026-10-19T07:05:00.000Z"}"#,
)?;
assert_eq!(r.order_status, Some(3)); // 3 = active in the list
assert!(r.order_date_time.is_some());

Fields§

§order_id: String

Id of the order at the exchange, in the form YYYYMMDD-ClassCode-OrderNumber. The only field the code requires.

§order_num: Option<i64>

Order number.

§client_code: Option<String>

Client code.

§executed_value: Option<Decimal>

Executed volume in the currency.

§trade_date: Option<String>

Trading date, kept as text.

§order_date_time: Option<DateTime<Utc>>

Time the order was placed (UTC). None if absent or the epoch.

§update_date_time: Option<DateTime<Utc>>

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

§ticker: Option<String>

Ticker.

§class_code: Option<String>

Class code (board).

§side: Option<i32>

1 buy, 2 sell.

§order_type: Option<i32>

Type of the order, the codes of the order list (see OrderSearchRequest).

§order_status: Option<i32>

Status of the order, the codes of the order list: 1 cancelled, 2 executed, 3 active. These are not the codes of order events.

§order_quantity: Option<Decimal>

Quantity of the order, in pieces.

§executed_quantity: Option<Decimal>

Executed quantity, in pieces.

§price: Option<Decimal>

Price of the order.

§average_price: Option<Decimal>

Average execution price.

§remained_quantity: Option<Decimal>

Remaining quantity, in pieces.

§order_quantity_lots: Option<Decimal>

Quantity of the order, in lots.

§remained_quantity_lots: Option<Decimal>

Remaining quantity, in lots.

§executed_quantity_lots: Option<Decimal>

Executed quantity, in lots.

§settlement_currency: Option<String>

Settlement currency.

§reject_reason: Option<String>

Why the order was rejected, if it was.

§take_price: Option<Decimal>

Conditional orders: take-profit and stop-loss trigger prices.

§stop_price: Option<Decimal>

Stop-loss trigger price of a conditional order.

§linked_order: Option<String>

Number of the linked order (the other leg of a TP+SL pair, or the order a stop produced).

§stop_order: Option<String>

Number of the stop order.

§market_take_profit: Option<i32>

1 market, 2 limit.

§market_stop_loss: Option<i32>

Stop-loss execution: 1 market order, 2 limit order.

§position_price_stop: Option<Decimal>

Stop price by position.

§position_price_limit: Option<Decimal>

Limit price by position.

Trait Implementations§

Source§

impl Clone for OrderRecord

Source§

fn clone(&self) -> OrderRecord

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 OrderRecord

Source§

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

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

impl<'de> Deserialize<'de> for OrderRecord

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