gs_quant.timeseries.econometrics.max_drawdown — gs_quant 0.1 documentation

# gs_quant.timeseries.econometrics.max_drawdown

`max_drawdown`(x, w=<gs_quant.timeseries.helper.Window object>)

  Compute the maximum peak to trough drawdown over a rolling window.

  Parameters

    - x (`Series`) – time series

    - w (`Union`[`Window`, `int`, `str`]) – Window, int, or str: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size and 10 the ramp up value. If w is a string, it should be a relative date like ‘1m’, ‘1d’, etc. Window size defaults to length of series.

  Return type

    `Series`

  Returns

    time series of rolling maximum drawdown

  Examples

  Compute the maximum peak to trough drawdown

      >>> series = generate_series(100)
      >>> max_drawdown(series)

  See also

  `returns()`