Update btanalysis.py

This commit is contained in:
Guitheg 2021-12-09 17:21:18 +01:00
parent 553c5e9606
commit c8c14aecfc

View File

@ -396,12 +396,12 @@ def calculate_trades_mdd(data: dict, trades: pd.DataFrame) -> float :
Give the max drawdown given each trades and the history candles. Give the max drawdown given each trades and the history candles.
The intervals dates used to calculate the max drawdown are the trades intervals dates. The intervals dates used to calculate the max drawdown are the trades intervals dates.
Args: Args:
:param data (dict) : dictionnary of candle dataframe per pair used to calculate the mdd. :param data: (dict) dictionnary of candle dataframe per pair used to calculate the mdd.
:param trades (pd.DataFrame): trades used to find the intervals dates. :param trades: (pd.DataFrame) trades used to find the intervals dates.
Returns: Returns:
:return: float: Give the maximum drawdown among each trades. :return: (float) Give the maximum drawdown among each trades.
:raise: ValueError if trade-dataframe was found empty. :raise: (ValueError) if trade-dataframe was found empty.
""" """
if len(trades) == 0: if len(trades) == 0:
raise ValueError("Trade dataframe empty") raise ValueError("Trade dataframe empty")