pub struct TradeRecord {
pub client_order_id: Option<String>,
pub data: Option<TradeData>,
pub order_num: Option<i64>,
pub trade_num: Option<i64>,
pub ticker: Option<String>,
pub class_code: Option<String>,
pub side: Option<String>,
pub price: Option<Decimal>,
pub volume: Option<Decimal>,
pub trade_quantity: Option<Decimal>,
pub trade_quantity_lots: Option<Decimal>,
pub trade_date_time: Option<String>,
}Expand description
One own trade (fill) in the trades list.
The current docs give a flat record (the trade fields sit in the record). The client_order_id and
data fields belong to an older shape and are None against a broker that follows the docs. A record
holds the exchange order number and the trade number, but not your clientOrderId and no commission.
Quantity comes in pieces and in lots.
§Examples
use brokapi_bcs_protocol::http::models::TradeRecord;
let t: TradeRecord = serde_json::from_str(
r#"{"orderNum":79000001,"tradeNum":5,"ticker":"SBER","classCode":"TQBR","side":"1",
"price":300.0,"volume":3000.0,"tradeQuantity":10,"tradeDateTime":"2026-10-19T07:05:00.000Z"}"#,
)?;
assert_eq!(t.trade_quantity, Some(dec!(10.0)));Fields§
§client_order_id: Option<String>Your order id. Older shape only: the current docs record has none.
data: Option<TradeData>A nested report. Older shape only: the current docs record is flat.
order_num: Option<i64>Number of the order at the exchange.
trade_num: Option<i64>Number of the trade.
ticker: Option<String>Ticker.
class_code: Option<String>Class code (board).
side: Option<String>1 buy, 2 sell.
price: Option<Decimal>Trade price.
volume: Option<Decimal>Trade volume in the currency.
trade_quantity: Option<Decimal>Quantity in pieces.
trade_quantity_lots: Option<Decimal>Quantity in lots.
trade_date_time: Option<String>Time of the trade (UTC), kept as the text the broker sends.
Trait Implementations§
Source§impl Clone for TradeRecord
impl Clone for TradeRecord
Source§fn clone(&self) -> TradeRecord
fn clone(&self) -> TradeRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TradeRecord
impl Debug for TradeRecord
Source§impl<'de> Deserialize<'de> for TradeRecord
impl<'de> Deserialize<'de> for TradeRecord
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TradeRecord
impl RefUnwindSafe for TradeRecord
impl Send for TradeRecord
impl Sync for TradeRecord
impl Unpin for TradeRecord
impl UnsafeUnpin for TradeRecord
impl UnwindSafe for TradeRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more