qis.plot_prices_with_dd¶
- qis.plot_prices_with_dd(prices, perf_stats_labels=(PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0)), perf_params=None, regime_benchmark=None, pivot_prices=None, regime_classifier=<qis.perfstats.regime_classifier.BenchmarkReturnsQuantilesRegime object>, var_format='{:, .1f}', dd_format='{:.0%}', digits_to_show=1, start_to_one=True, sharpe_format='{:.2f}', x_date_freq='YE', is_log=False, remove_xticklabels_ax1=True, title='Performance', dd_title='Running Drawdown', dd_legend_type=DdLegendType.SIMPLE, axs=None, **kwargs)[source]¶
plot price series above their running drawdown, on a shared date axis.
Two stacked panels:
plot_prices()on top, the running drawdown from the prior peak below. The pairing is the point — a performance line alone hides the path, and the drawdown panel puts the worst of it directly under the level that produced it.Arguments shared with every
plot_*function are documented inqis/docs/plotting_kwargs.md. Arguments in common withplot_prices()mean the same thing here and are passed straight through.- Parameters:
prices (DataFrame | Series) – price or NAV levels indexed by date, one column per instrument
perf_stats_labels (List[PerfStat]) – statistics appended to each legend entry of the upper panel
perf_params (PerfParams) – annualisation, frequency and rate conventions for those statistics
regime_benchmark (str) – column name whose returns classify the regime shading on both panels
pivot_prices (Series) – benchmark levels when the benchmark is not one of the plotted columns
regime_classifier (BenchmarkReturnsQuantilesRegime) – how the benchmark return is mapped to a regime
var_format (str) – format for the price levels in the upper legend
dd_format (str) – format for the drawdown, conventionally a percentage
digits_to_show (int) – significant digits for the performance statistics
start_to_one (bool) – rebase every series to 1.0 at its first observation
sharpe_format (str) – format for Sharpe ratios
x_date_freq (str) – tick frequency on the shared date axis
is_log (bool) – log scale on the price panel only; the drawdown panel is always linear
remove_xticklabels_ax1 (bool) – drop the date labels from the upper panel, since the two panels share an axis and one set of labels is enough
title (str) – title of the price panel
dd_title (str) – title of the drawdown panel
dd_legend_type (DdLegendType) – what the drawdown legend reports - the maximum alone, or the full drawdown statistics
axs (List[Axes]) – the two axes to draw on, price first. None creates a two-panel figure
- Returns:
the figure drawn on, or None when
axswas supplied- Return type: