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§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<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 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