pub struct StreakStats {
pub max_consecutive_wins: u32,
pub max_consecutive_losses: u32,
pub current_streak: i32,
}Expand description
Consecutive win/loss streak analysis.
Fields§
§max_consecutive_wins: u32Maximum consecutive winning trades.
max_consecutive_losses: u32Maximum consecutive losing trades.
current_streak: i32Current streak (positive = wins, negative = losses, 0 = no trades or breakeven).
Implementations§
Source§impl StreakStats
impl StreakStats
Sourcepub fn from_trades(trades: &[&TradeResult]) -> Self
pub fn from_trades(trades: &[&TradeResult]) -> Self
Compute streak statistics from a chronologically-ordered trade log.
Sourcepub fn from_completed_positions(positions: &[CompletedPosition]) -> Self
pub fn from_completed_positions(positions: &[CompletedPosition]) -> Self
Compute FutureQuote streaks from completed campaigns in deterministic close order.
Trait Implementations§
Source§impl Clone for StreakStats
impl Clone for StreakStats
Source§impl Debug for StreakStats
impl Debug for StreakStats
Source§impl<'de> Deserialize<'de> for StreakStats
impl<'de> Deserialize<'de> for StreakStats
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 StreakStats
impl RefUnwindSafe for StreakStats
impl Send for StreakStats
impl Sync for StreakStats
impl Unpin for StreakStats
impl UnsafeUnpin for StreakStats
impl UnwindSafe for StreakStats
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