pub struct Metrics {Show 17 fields
pub bars: usize,
pub initial_capital: f64,
pub final_equity: f64,
pub net_profit: f64,
pub total_return: f64,
pub annual_return: f64,
pub max_drawdown: f64,
pub sharpe: f64,
pub sortino: f64,
pub calmar: f64,
pub trades: usize,
pub wins: usize,
pub losses: usize,
pub win_rate: f64,
pub profit_factor: f64,
pub avg_trade: f64,
pub exposure: f64,
}Expand description
Standard summary metrics of a run, from Backtest::generate_metrics. Every
figure is reported with the context that makes it comparable — returns beside
drawdown, wins beside profit factor.
Fields§
§bars: usizeBars the strategy ran over.
initial_capital: f64§final_equity: f64§net_profit: f64§total_return: f64Total return over the run, as a fraction of starting capital.
annual_return: f64Return annualised from the window’s length.
max_drawdown: f64Largest peak-to-trough fall in close equity, as a fraction of the peak.
sharpe: f64Annualised mean return over its standard deviation.
sortino: f64As Sharpe, but penalising only downside deviation.
calmar: f64Annual return over max drawdown: profit per unit of worst loss.
trades: usizeClosed trades — winners, losers and breakevens.
wins: usize§losses: usize§win_rate: f64§profit_factor: f64Gross profit over gross loss. Below 1.0 loses money.
avg_trade: f64Average profit per closed trade.
exposure: f64Fraction of bars holding a position; can exceed 1.0 with pyramiding.
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.