sf_quant.performance.generate_drawdown_chart#

sf_quant.performance.generate_drawdown_chart(drawdowns: DrawdownSchema, title: str, subtitle: str | None = None, file_name: str | None = None) None#

Plot portfolio drawdowns over time.

This function generates a line chart of drawdowns. Drawdowns are expressed as negative percentages from the peak value.

Parameters#

drawdownsDrawdownSchema

Portfolio drawdowns validated against DrawdownSchema. Must include the following columns:

  • date (date): The observation date.

  • drawdown (float): Daily portfolio drawdown.

titlestr

The chart’s main title.

subtitlestr or None, optional

The chart’s subtitle, shown beneath the main title. Defaults to None.

file_namestr, optional

If not None, the plot is saved to the given file path. Defaults to just displaying the chart.

Returns#

None

Displays the drawdown chart using Matplotlib and Seaborn.

Notes#

Drawdowns are expressed in percentages for visualization.