#[non_exhaustive]pub struct PerformanceMetrics {Show 25 fields
pub total_return_pct: f64,
pub annualized_return_pct: f64,
pub sharpe_ratio: f64,
pub sortino_ratio: f64,
pub max_drawdown_pct: f64,
pub max_drawdown_duration: i64,
pub win_rate: f64,
pub profit_factor: f64,
pub avg_trade_return_pct: f64,
pub avg_win_pct: f64,
pub avg_loss_pct: f64,
pub avg_trade_duration: f64,
pub total_trades: usize,
pub winning_trades: usize,
pub losing_trades: usize,
pub largest_win: f64,
pub largest_loss: f64,
pub max_consecutive_wins: usize,
pub max_consecutive_losses: usize,
pub calmar_ratio: f64,
pub total_commission: f64,
pub long_trades: usize,
pub short_trades: usize,
pub total_signals: usize,
pub executed_signals: usize,
}Expand description
Performance metrics summary
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.total_return_pct: f64Total return percentage
annualized_return_pct: f64Annualized return percentage (assumes 252 trading days)
sharpe_ratio: f64Sharpe ratio (risk-free rate = 0)
sortino_ratio: f64Sortino ratio (downside deviation)
max_drawdown_pct: f64Maximum drawdown percentage (0.0-1.0)
max_drawdown_duration: i64Maximum drawdown duration in bars
win_rate: f64Win rate (profitable trades / total trades)
profit_factor: f64Profit factor (gross profit / gross loss)
avg_trade_return_pct: f64Average trade return percentage
avg_win_pct: f64Average winning trade return percentage
avg_loss_pct: f64Average losing trade return percentage
avg_trade_duration: f64Average trade duration in bars
total_trades: usizeTotal number of trades
winning_trades: usizeNumber of winning trades
losing_trades: usizeNumber of losing trades
largest_win: f64Largest winning trade P&L
largest_loss: f64Largest losing trade P&L
max_consecutive_wins: usizeMaximum consecutive wins
max_consecutive_losses: usizeMaximum consecutive losses
calmar_ratio: f64Calmar ratio (annualized return / max drawdown)
total_commission: f64Total commission paid
long_trades: usizeNumber of long trades
short_trades: usizeNumber of short trades
total_signals: usizeTotal signals generated
executed_signals: usizeSignals that were executed
Implementations§
Trait Implementations§
Source§impl Clone for PerformanceMetrics
impl Clone for PerformanceMetrics
Source§fn clone(&self) -> PerformanceMetrics
fn clone(&self) -> PerformanceMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PerformanceMetrics
impl Debug for PerformanceMetrics
Source§impl<'de> Deserialize<'de> for PerformanceMetrics
impl<'de> Deserialize<'de> for PerformanceMetrics
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>,
Auto Trait Implementations§
impl Freeze for PerformanceMetrics
impl RefUnwindSafe for PerformanceMetrics
impl Send for PerformanceMetrics
impl Sync for PerformanceMetrics
impl Unpin for PerformanceMetrics
impl UnsafeUnpin for PerformanceMetrics
impl UnwindSafe for PerformanceMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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