max_drawdown

qf_lib.common.utils.returns.max_drawdown.max_drawdown(input_data: Union[QFSeries, QFDataFrame], frequency: Optional[Frequency] = None) Union[float, QFSeries][source]

Finds maximal drawdown for the given timeseries of prices.

Parameters:
  • input_data (QFSeries, QFDataFrame) – timeseries of prices/returns

  • frequency (Frequency) – optional parameter that improves teh performance of the function it is not need to infer the frequency

Returns:

  • maximal drawdown for the given timeseries of prices expressed as the percentage value (e.g. 0.5 corresponds

  • to the 50% drawdown)