View source: R/performance_analytics.R
| analyze_drawdowns | R Documentation |
Detailed analysis of drawdown periods including depth, duration, and recovery.
analyze_drawdowns(drawdowns, returns)
drawdowns |
Drawdown series (negative values) |
returns |
Return series for additional metrics |
List with drawdown statistics
data("sample_prices_weekly")
momentum <- calc_momentum(sample_prices_weekly, lookback = 12)
selected <- filter_top_n(momentum, n = 10)
weights <- weight_equally(selected)
result <- run_backtest(sample_prices_weekly, weights)
dd_analysis <- analyze_drawdowns(result$portfolio_value, result$dates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.