Quant.Strategy.Performance (quant v0.1.0-alpha.1)
Performance analysis for backtesting results.
This module provides functionality to analyze the performance of trading strategies including metrics like returns, Sharpe ratio, drawdowns, and other risk metrics.
Future Implementation
This module is currently a stub and will be fully implemented with:
- Total return and annualized return calculations
- Risk-adjusted returns (Sharpe ratio, Sortino ratio)
- Drawdown analysis (maximum drawdown, recovery time)
- Win rate and profit factor
- Risk metrics and volatility analysis
Summary
Functions
Analyzes the performance of backtesting results.
Functions
@spec analyze( Explorer.DataFrame.t(), keyword() ) :: {:ok, map()} | {:error, term()}
Analyzes the performance of backtesting results.
Currently returns a placeholder response. Will be fully implemented to provide comprehensive performance metrics.
Parameters
backtest_results- DataFrame containing backtest results with portfolio values, trades, etc.opts- Options for performance analysis (risk-free rate, benchmark, etc.)
Returns
{:ok, performance_metrics}- Map containing performance metrics{:error, reason}- Error tuple if analysis fails
Examples
iex> backtest_df = Explorer.DataFrame.new(%{
...> portfolio_value: [10000, 10100, 10050, 10200],
...> trade_return: [0.0, 0.01, -0.005, 0.015]
...> })
iex> {:ok, _metrics} = Quant.Strategy.Performance.analyze(backtest_df, [])
{:ok, %{status: :not_implemented}}