pub struct TradeData {Show 15 fields
pub gateway_name: String,
pub symbol: String,
pub exchange: Exchange,
pub orderid: String,
pub tradeid: String,
pub direction: Option<Direction>,
pub offset: Offset,
pub price: f64,
pub volume: f64,
pub datetime: Option<DtNs>,
pub commission: f64,
pub slippage: f64,
pub trade_pnl: f64,
pub name: String,
pub traded_amount: f64,
}Expand description
成交回报数据:一单可多笔。
Fields§
§gateway_name: String上游网关名
symbol: String合约代码
exchange: Exchange交易所
orderid: String所属委托号(网关内唯一)
tradeid: String成交号(网关内唯一)
direction: Option<Direction>方向(缺省 None)
offset: Offset开平(缺省 NONE)
price: f64成交价
volume: f64成交量
datetime: Option<DtNs>时间戳(UTC 纪元纳秒;缺省 None)
commission: f64手续费(enkeep 扩展)
slippage: f64滑点(enkeep 扩展)
trade_pnl: f64平仓盈亏(平仓时计算,enkeep 扩展)
name: String证券名称
traded_amount: f64成交金额
Implementations§
Source§impl TradeData
impl TradeData
Sourcepub fn en_symbol_into(&self, buf: &mut String)
pub fn en_symbol_into(&self, buf: &mut String)
零分配版本:追加到复用缓冲。
Sourcepub fn en_orderid(&self) -> String
pub fn en_orderid(&self) -> String
en_orderid = "{gateway_name}.{orderid}"(object.py:230)。
Sourcepub fn en_tradeid(&self) -> String
pub fn en_tradeid(&self) -> String
en_tradeid = "{gateway_name}.{tradeid}"(object.py:231)。
Trait Implementations§
impl StructuralPartialEq for TradeData
Auto Trait Implementations§
impl Freeze for TradeData
impl RefUnwindSafe for TradeData
impl Send for TradeData
impl Sync for TradeData
impl Unpin for TradeData
impl UnsafeUnpin for TradeData
impl UnwindSafe for TradeData
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