pub struct BacktestResult {
pub total_return: Decimal,
pub sharpe_ratio: Decimal,
pub max_drawdown: Decimal,
pub win_rate: Decimal,
pub trade_count: u64,
pub final_equity: Decimal,
pub equity_curve: Vec<Decimal>,
}Expand description
Summary statistics produced after a completed backtest run.
Fields§
§total_return: DecimalTotal return over the period: (final_equity - initial_capital) / initial_capital.
sharpe_ratio: DecimalAnnualised Sharpe ratio (assuming 252 trading days; NaN-free — returns 0 if std == 0).
max_drawdown: DecimalMaximum peak-to-trough equity drawdown as a fraction, e.g. dec!(0.15) = 15%.
win_rate: DecimalFraction of closed trades that were profitable.
trade_count: u64Total number of trades (fills) executed.
final_equity: DecimalFinal equity value at the end of the period.
equity_curve: Vec<Decimal>Equity curve sampled once per bar.
Trait Implementations§
Source§impl Clone for BacktestResult
impl Clone for BacktestResult
Source§impl Debug for BacktestResult
impl Debug for BacktestResult
Source§impl<'de> Deserialize<'de> for BacktestResult
impl<'de> Deserialize<'de> for BacktestResult
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 BacktestResult
impl RefUnwindSafe for BacktestResult
impl Send for BacktestResult
impl Sync for BacktestResult
impl Unpin for BacktestResult
impl UnsafeUnpin for BacktestResult
impl UnwindSafe for BacktestResult
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