pub struct SessionPnlSnapshot {
pub realised: f64,
pub fees: f64,
pub trades: u32,
pub wins: u32,
pub losses: u32,
pub breakevens: u32,
pub halted: bool,
pub last_reset_day: u64,
}Expand description
Restart-durable snapshot of a SessionPnl’s mutable state.
Captures the running totals and halt flag — not the configured
loss_limit, the symbol, or the clock. Those come from the live
instance on restore, so an operator can adjust the loss limit between
runs and the new value takes effect immediately.
Restore via SessionPnl::restore. Because last_reset_day is kept,
calling SessionPnl::tick right after a restore correctly rolls the
session over if the snapshot was taken on an earlier UTC day.
Fields§
§realised: f64Cumulative gross realised PnL, in quote currency.
fees: f64Cumulative fees paid this session, in quote currency.
trades: u32Total trades recorded this session.
wins: u32Wins (net PnL > 0).
losses: u32Losses (net PnL < 0).
breakevens: u32Break-evens (net PnL == 0).
halted: boolWhether the session was halted by the loss cap when snapshotted.
last_reset_day: u64UTC day number of the last reset, for rollover detection on restore.
Trait Implementations§
Source§impl Clone for SessionPnlSnapshot
impl Clone for SessionPnlSnapshot
Source§fn clone(&self) -> SessionPnlSnapshot
fn clone(&self) -> SessionPnlSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionPnlSnapshot
impl Debug for SessionPnlSnapshot
Source§impl<'de> Deserialize<'de> for SessionPnlSnapshot
impl<'de> Deserialize<'de> for SessionPnlSnapshot
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>,
Source§impl PartialEq for SessionPnlSnapshot
impl PartialEq for SessionPnlSnapshot
Source§fn eq(&self, other: &SessionPnlSnapshot) -> bool
fn eq(&self, other: &SessionPnlSnapshot) -> bool
self and other values to be equal, and is used by ==.