Skip to content

Feature: Add comprehensive risk metrics to simulation results #175

Description

@ch55secake

Problem

The trading simulation currently reports only basic metrics: final value, total return, buy-and-hold return, and number of trades. For a system targeting 5-10% ROI, these metrics are insufficient to evaluate whether the returns are worth the risk taken.

Proposed Metrics

Add the following to the simulation results dictionary:

Metric Description
Sharpe ratio Annualised risk-adjusted return
Sortino ratio Sharpe variant penalising only downside volatility
Maximum drawdown Largest peak-to-trough decline
Max drawdown duration Longest time to recover from a drawdown
Calmar ratio Annualised return / max drawdown
Win rate % of trades that were profitable
Profit factor Gross profit / gross loss
Average win/loss ratio Mean winning trade / mean losing trade
Annualised volatility Std dev of returns, annualised
Value at Risk (VaR) 95th percentile daily loss
Beta to benchmark Correlation with buy-and-hold

Proposed Location

Create a RiskMetrics dataclass or utility in src/simulation/ that takes the portfolio history DataFrame and computes all metrics. Call it at the end of TradingSimulator.simulate().

Impact

  • Proper risk-adjusted evaluation of strategies
  • Enables filtering strategies by risk profile, not just return
  • Required foundation for factor attribution (Factor model #28)

Files likely affected

  • src/simulation/trading_simulator.py
  • New: src/simulation/risk_metrics.py

Metadata

Metadata

Labels

enhancementNew feature or requestin-progressA task that is currently in progress

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions