qis.plot_top_drawdowns_paths¶
- qis.plot_top_drawdowns_paths(price, freq='D', max_num=10, date_format='%d%b%Y', title=None, var_format='{:.0%}', legend_loc='lower left', highlight_ongoing=False, x_limits=(0.0, None), y_limits=(None, 0.0), ax=None, **kwargs)[source]¶
overlay the deepest drawdown episodes, each re-indexed to the number of grid steps since its start.
The episodes come from
compute_drawdowns_stats_tableon the samefreqgrid as the plotted paths. Each path is price / peak - 1 from the episode’s start to its end, plotted against the number offreqobservations since the start: calendar days on the default ‘D’ grid, native observations withfreq=None. The legend’sdays_ddis the episode table’s duration: calendar days for any non-Nonefreq, observations for None.- Parameters:
price (Series) – level series of one asset
freq (str | None) – grid to rebase the levels to before finding episodes; None keeps the native grid
max_num (int) – number of deepest episodes to draw
date_format (str) – format of the start and end dates in the legend
highlight_ongoing (bool) – draw the episode that is still under water at the last date (
is_recovered=False) solid black and the others dottedtitle (str | None)
var_format (str)
legend_loc (str)
ax (Axes)
- Returns:
the figure
- Return type: