pub struct Trade {Show 22 fields
pub trade_id: String,
pub instrument_name: String,
pub order_id: String,
pub direction: OrderSide,
pub amount: f64,
pub price: f64,
pub timestamp: i64,
pub fee: f64,
pub fee_currency: String,
pub liquidity: Liquidity,
pub mark_price: f64,
pub index_price: f64,
pub instrument_kind: Option<InstrumentKind>,
pub trade_seq: Option<u64>,
pub user_role: Option<String>,
pub block_trade: Option<bool>,
pub underlying_price: Option<f64>,
pub iv: Option<f64>,
pub label: Option<String>,
pub profit_loss: Option<f64>,
pub tick_direction: Option<i32>,
pub self_trade: Option<bool>,
}Expand description
Trade execution information
Fields§
§trade_id: StringUnique trade identifier
instrument_name: StringInstrument name
order_id: StringOrder ID that generated this trade
direction: OrderSideTrade direction (buy/sell)
amount: f64Trade amount
price: f64Execution price
timestamp: i64Trade timestamp
fee: f64Fee amount
fee_currency: StringFee currency
liquidity: LiquidityLiquidity type (maker/taker)
mark_price: f64Mark price at time of trade
index_price: f64Index price at time of trade
instrument_kind: Option<InstrumentKind>Instrument kind
trade_seq: Option<u64>Trade sequence number
user_role: Option<String>User role in the trade
block_trade: Option<bool>Whether this is a block trade
underlying_price: Option<f64>Underlying price (for options)
iv: Option<f64>Implied volatility (for options)
label: Option<String>Label associated with the order
profit_loss: Option<f64>Profit and loss from this trade
tick_direction: Option<i32>Tick direction
self_trade: Option<bool>Whether this trade was self-traded
Implementations§
Source§impl Trade
impl Trade
Sourcepub fn notional_value(&self) -> f64
pub fn notional_value(&self) -> f64
Calculate the notional value of the trade
Sourcepub fn fee_percentage(&self) -> f64
pub fn fee_percentage(&self) -> f64
Get fee as percentage of notional
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trade
impl<'de> Deserialize<'de> for Trade
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 Trade
impl RefUnwindSafe for Trade
impl Send for Trade
impl Sync for Trade
impl Unpin for Trade
impl UnwindSafe for Trade
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