pub struct Metrics {
pub pnl: f64,
pub return_pct: f64,
pub sharpe: f64,
pub sortino: f64,
pub calmar: f64,
pub max_drawdown: f64,
pub win_rate: f64,
pub profit_factor: f64,
pub num_trades: usize,
}Expand description
Summary performance metrics.
Fields§
§pnl: f64Absolute PnL (final equity − initial equity).
return_pct: f64Total return in percent.
sharpe: f64Per-bar Sharpe ratio (mean / std of per-bar equity returns).
sortino: f64Per-bar Sortino ratio (mean / downside deviation of per-bar returns).
calmar: f64Calmar ratio (total return divided by maximum drawdown).
max_drawdown: f64Maximum drawdown in percent (peak-to-trough).
win_rate: f64Fraction of trades that were profitable, in percent.
profit_factor: f64Gross profit divided by gross loss.
num_trades: usizeNumber of completed trades.
Trait Implementations§
impl StructuralPartialEq for Metrics
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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,
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