TopDrawdownDecorator

class qf_lib.plotting.decorators.top_drawdown_decorator.TopDrawdownDecorator(prices: QFSeries, count: int, colors: Optional[List[str]] = None, key: Optional[str] = None)[source]

Bases: ChartDecorator

Highlights the top drawdowns in a specified series.

The top count amount of drawdowns will be highlighted. If colors is None then a default list of colours will be used, you can override it by specifying a list of strings containing color names or hex codes.

Parameters:
  • prices (QFSeries) – A series from which drawdowns will be calculated.

  • count (int) – The amount of longest drawdowns to highlight.

  • colors (List[str]) – A list of colours to use to highlight the drawdowns.

Methods:

decorate(chart)

Modifies the axes object taken from the chart (e.g.

decorate(chart: Chart)[source]

Modifies the axes object taken from the chart (e.g. adds legend, draws cone, etc.).