pub struct TradeResultMsg {Show 14 fields
pub position_id: String,
pub symbol: String,
pub side: String,
pub entry_price: f64,
pub exit_price: f64,
pub size: f64,
pub pnl: f64,
pub commission: f64,
pub swap: f64,
pub gross_pnl: Option<f64>,
pub open_ts: String,
pub close_ts: String,
pub close_reason: String,
pub group: Option<String>,
}Expand description
Wire-safe mirror of TradeResult.
Fields§
§position_id: String§symbol: String§side: String§entry_price: f64§exit_price: f64§size: f64§pnl: f64Realized profit and loss for this close, already net of commission and swap.
commission: f64Account-currency commission settled on this row and already subtracted from pnl.
The row that fully closes a position also settles that position’s entry commission, because entry commission belongs to the position rather than to any one close.
swap: f64Account-currency swap settled on this row, which is non-zero only on the row that fully closes a position.
gross_pnl: Option<f64>Profit and loss before commission and swap, present only when either was settled.
open_ts: String§close_ts: String§close_reason: String§group: Option<String>Trait Implementations§
Source§impl Clone for TradeResultMsg
impl Clone for TradeResultMsg
Source§fn clone(&self) -> TradeResultMsg
fn clone(&self) -> TradeResultMsg
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 TradeResultMsg
impl Debug for TradeResultMsg
Source§impl<'de> Deserialize<'de> for TradeResultMsg
impl<'de> Deserialize<'de> for TradeResultMsg
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TradeResultMsg, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TradeResultMsg, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TradeResultMsg
impl Serialize for TradeResultMsg
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TradeResultMsg
impl RefUnwindSafe for TradeResultMsg
impl Send for TradeResultMsg
impl Sync for TradeResultMsg
impl Unpin for TradeResultMsg
impl UnsafeUnpin for TradeResultMsg
impl UnwindSafe for TradeResultMsg
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more