pub struct TradeOutcome {
pub symbol: String,
pub close_side: Side,
pub qty: f64,
pub entry_price: f64,
pub exit_price: f64,
pub gross_pnl: f64,
pub fee: f64,
pub closed_at: DateTime<Utc>,
}Expand description
A single realised trade — open → close — recorded by the engine.
gross_pnl is in quote currency, before fee. `net_pnl = gross_pnl
- fee
. The "side" is the side of the *closing* fill (so a long position is closed withSide::Sell`).
Fields§
§symbol: StringSymbol the trade was on.
close_side: SideSide of the closing fill (Sell to close a long, etc.).
qty: f64Closed quantity.
entry_price: f64Average entry price of the closed quantity.
exit_price: f64Fill price of the close.
gross_pnl: f64Gross PnL on the closed quantity, in quote currency, before fees.
fee: f64Fee charged to this close, in quote currency.
closed_at: DateTime<Utc>When the close fill occurred.
Implementations§
Trait Implementations§
Source§impl Clone for TradeOutcome
impl Clone for TradeOutcome
Source§fn clone(&self) -> TradeOutcome
fn clone(&self) -> TradeOutcome
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 TradeOutcome
impl Debug for TradeOutcome
Source§impl<'de> Deserialize<'de> for TradeOutcome
impl<'de> Deserialize<'de> for TradeOutcome
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
Source§impl PartialEq for TradeOutcome
impl PartialEq for TradeOutcome
Source§fn eq(&self, other: &TradeOutcome) -> bool
fn eq(&self, other: &TradeOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TradeOutcome
impl Serialize for TradeOutcome
impl StructuralPartialEq for TradeOutcome
Auto Trait Implementations§
impl Freeze for TradeOutcome
impl RefUnwindSafe for TradeOutcome
impl Send for TradeOutcome
impl Sync for TradeOutcome
impl Unpin for TradeOutcome
impl UnsafeUnpin for TradeOutcome
impl UnwindSafe for TradeOutcome
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