drawdown_tms¶
-
qf_lib.common.utils.returns.drawdown_tms.
drawdown_tms
(input_data: InputData, frequency: qf_lib.common.enums.frequency.Frequency = None) → InputData[source]¶ Calculates the timeseries of the same dates as prices_tms, which contains the drawdown value for each date.
- Parameters
input_data (QFSeries, QFDataFrame) – QF timeseries or multiple timeseries grouped into a DataFrame
frequency (Frequency) – optional parameter that improves teh performance of the function as to_prices does not need to infer the frequency
- Returns
series of drawdowns (drawdown for each day). Drawdown for a given date is defined as the percentage difference between the the maximal price value up to the given date and the price value for that date.
- Return type