See here for the example code that generated this page

DrawdownPlot Examples

DrawdownPlot visualizes strategy drawdowns from peak cumulative performance. Key features:




Example 1: Basic Drawdown Comparison

Compare drawdowns across multiple strategies. Hover over lines to see maximum drawdown for each strategy.




Strategy Drawdowns

Compare drawdown profiles of 8 strategies. The Momentum strategy shows a significant drawdown mid-period. Hover over any line to see its maximum drawdown value.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 2: Multiple Metrics with Transforms

Select between different PnL metrics, each with its own transform (cumulative or cumprod).




Multi-Metric Drawdown Analysis

Use the 'Metric' dropdown to switch between daily_pnl (cumulative sum), daily_pnl_gross (cumulative sum), or daily_return (cumulative product for wealth drawdown). The drawdown is computed from the cumulative result.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 3: Drawdowns by Style

Group strategies by investment style (Factor vs Alternative) to see aggregate drawdown behavior.




Drawdowns by Investment Style

Use the 'Color by' dropdown to switch between viewing individual strategies or aggregated by style. Factor strategies tend to have correlated drawdowns while Alternatives provide diversification.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 4: With Filters

Filter to specific regions or risk levels to focus analysis.




Filtered Drawdown Analysis

Use filters to select specific regions or styles. Compare how high vs low risk strategies behave during drawdown periods.

Filters

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 4b: Choices vs Filters

Demonstrates the difference between choices (single-select) and filters (multi-select).




Drawdowns with Single-Select Region

This example demonstrates the difference between choices and filters: - **Region (choice)**: Single-select dropdown - pick exactly ONE region at a time - **Style (filter)**: Multi-select dropdown - can select multiple styles Use choices when the user must select exactly one option (like comparing drawdowns region by region).

Filters

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 5: Faceted View

Split the view by region or style to see drawdowns in separate panels.




Faceted Drawdown Analysis

Use Facet dropdowns to split the view. Try faceting by style to compare Factor vs Alternative drawdowns. The Metric dropdown lets you switch between daily_pnl and daily_pnl_gross.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --

Facets

0.5 (0.25 - 2.5)

Data: strategy_data




Example 6: Custom Color Mapping

Use custom colors to highlight risk levels - red for high risk, green for low risk.




Drawdowns with Custom Risk Colors

When coloring by risk_level, High risk is shown in red, Medium in orange, and Low in green. This makes it easy to visually identify which risk profiles have the deepest drawdowns.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 7: Line-Only View

View drawdowns as lines without fill area for cleaner visualization with many strategies.




Drawdowns (No Fill)

Without fill, it's easier to distinguish overlapping drawdown profiles. Useful when analyzing many strategies simultaneously.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 8: Filter by Day of Week

Subset data to specific days of the week. The max drawdown is recalculated based only on the selected days. This is useful for analyzing day-of-week effects or comparing weekday vs weekend performance.




Drawdowns by Day of Week

Filter to specific days using the dropdown. For example, select only Monday and Friday to see drawdowns calculated from just those days' PnL. The max drawdown shown on hover reflects only the filtered subset.

Filters

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 9: Weekdays Only Analysis

Pre-filter to weekdays only (Monday-Friday). This demonstrates setting default filter values to exclude weekends from the drawdown calculation.




Weekday Drawdowns Only

Pre-filtered to weekdays. Saturday and Sunday are excluded from the drawdown calculation. You can adjust the filter to include/exclude specific days. Use the Metric dropdown to switch between cumulative PnL and wealth (cumprod) drawdowns.

Filters

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Example 10: Day Filtering with Style Comparison

Combine day-of-week filtering with faceting by investment style. This lets you compare how Factor vs Alternative strategies perform on specific days.




Day-Filtered Drawdowns by Style

Filter by day of week to see how drawdowns differ. Try selecting only Monday to see 'Monday effect' drawdowns, or compare Tuesday vs Thursday performance. The faceted view separates Factor and Alternative strategies.

Filters

Plot Attributes

days
(days)
Start: --   End: --   Duration: --

Facets

0.5 (0.25 - 2.5)

Data: strategy_data




Example 11: Wealth-Based Drawdown (Cumprod)

For return-based data, use cumprod to compute cumulative wealth, then show drawdown from peak wealth.




Wealth Drawdown (Cumprod)

When using daily_return with cumprod transform, the chart shows drawdown from peak wealth. This is the standard way to measure drawdown for return series: compute cumulative wealth (product of 1+r), then measure how far below the running maximum.

Plot Attributes

days
(days)
Start: --   End: --   Duration: --
0.5 (0.25 - 2.5)

Data: strategy_data




Understanding Drawdowns

Use Cases


This page was created using JSPlots.jl v0.6.3.