drawdown#

drawdown(close, offset=None, **kwargs)[source]#

Drawdown (DD)

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.

Sources:

https://www.investopedia.com/terms/d/drawdown.asp

Calculation:

PEAKDD = close.cummax() DD = PEAKDD - close DD% = 1 - (close / PEAKDD) DDlog = log(PEAKDD / close)

Args:

close (pd.Series): Series of ‘close’s. offset (int): How many periods to offset the result. Default: 0

Kwargs:

fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method

Returns:

pd.DataFrame: drawdown, drawdown percent, drawdown log columns

Return type

DataFrame