pub struct BacktestResult {Show 17 fields
pub general_performance: GeneralPerformanceMetrics,
pub options_metrics: OptionsSpecificMetrics,
pub trade_statistics: TradeStatistics,
pub drawdown_analysis: DrawdownAnalysis,
pub capital_utilization: CapitalUtilization,
pub time_series: TimeSeriesData,
pub trades: Vec<TradeRecord>,
pub market_conditions: Option<MarketConditionMetrics>,
pub volatility_data: Option<VolatilityData>,
pub risk_metrics: Option<AdvancedRiskMetrics>,
pub monte_carlo_simulation: Option<SimulationResult>,
pub strategy_name: String,
pub test_period_start: DateTime<Utc>,
pub test_period_end: DateTime<Utc>,
pub initial_capital: Decimal,
pub final_capital: Decimal,
pub custom_metrics: HashMap<String, Decimal>,
}Expand description
Comprehensive container for all results generated during a backtest simulation.
This struct aggregates various performance metrics, time-series data, trade details, risk analysis, and context related to a specific trading strategy simulation.
Fields§
§general_performance: GeneralPerformanceMetricsCore performance metrics applicable to most trading strategies. Includes returns, risk measures (like volatility), risk-adjusted returns (like Sharpe), and win/loss statistics.
options_metrics: OptionsSpecificMetricsMetrics specifically relevant to options trading strategies. Includes metrics like return on margin, premium capture, and average Greek exposures.
trade_statistics: TradeStatisticsStatistical analysis of the trades executed during the backtest. Contains counts, averages, and distributions related to trade outcomes.
drawdown_analysis: DrawdownAnalysisAnalysis of the portfolio’s value declines (drawdowns) from peak equity. Includes metrics like maximum drawdown and longest drawdown period.
capital_utilization: CapitalUtilizationMetrics detailing how capital was deployed and managed throughout the backtest. Includes average/max capital usage, margin metrics, and premium flows.
time_series: TimeSeriesDataTime-series data tracking the evolution of key portfolio metrics over the backtest period. Includes equity curve, drawdown curve, margin usage, position counts, and potentially Greek exposures.
trades: Vec<TradeRecord>A detailed record of each individual trade executed during the backtest simulation.
market_conditions: Option<MarketConditionMetrics>Optional metrics describing the market environment during the backtest period. Can include classifications like bull/bear market days or high/low volatility periods.
volatility_data: Option<VolatilityData>Optional data related to implied volatility observed during the backtest, often at trade execution times. Includes metrics like average IV traded or IV rank/percentile.
risk_metrics: Option<AdvancedRiskMetrics>Optional advanced risk analytics beyond standard deviation. May include metrics like Value at Risk (VaR), Expected Shortfall (ES), or Ulcer Index.
monte_carlo_simulation: Option<SimulationResult>Optional results from Monte Carlo simulations performed on the strategy’s outcomes. Provides probabilistic insights into future performance potential and risk.
strategy_name: StringThe name identifier of the trading strategy being backtested.
test_period_start: DateTime<Utc>The starting date and time of the backtest period.
test_period_end: DateTime<Utc>The ending date and time of the backtest period.
initial_capital: DecimalThe initial amount of capital allocated at the beginning of the backtest.
final_capital: DecimalThe final amount of capital remaining at the end of the backtest.
custom_metrics: HashMap<String, Decimal>A flexible map allowing storage of custom, strategy-specific metrics. Keys are metric names (strings), and values are the calculated metric values (Decimals).
Trait Implementations§
Source§impl Clone for BacktestResult
impl Clone for BacktestResult
Source§impl Debug for BacktestResult
impl Debug for BacktestResult
Source§impl Default for BacktestResult
impl Default 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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.