- drawdown(close, offset=None, **kwargs)[source]#
Drawdown is a peak-to-trough decline during a specific period for an investment, trading account, or fund. It is usually quoted as the percentage between the peak and the subsequent trough.
PEAKDD = close.cummax() DD = PEAKDD - close DD% = 1 - (close / PEAKDD) DDlog = log(PEAKDD / close)
close (pd.Series): Series of ‘close’s. offset (int): How many periods to offset the result. Default: 0
fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method
pd.DataFrame: drawdown, drawdown percent, drawdown log columns
- Return type: