diff --git a/freqtrade/data/metrics.py b/freqtrade/data/metrics.py index 87a60daf0..09410667b 100644 --- a/freqtrade/data/metrics.py +++ b/freqtrade/data/metrics.py @@ -163,21 +163,12 @@ def calculate_underwater( @dataclass() class DrawDownResult: - __slots__ = [ - "drawdown_abs", - "high_date", - "low_date", - "high_value", - "low_value", - "relative_account_drawdown", - ] - - drawdown_abs: float - high_date: datetime - low_date: datetime - high_value: float - low_value: float - relative_account_drawdown: float + drawdown_abs: float = 0.0 + high_date: datetime = None + low_date: datetime = None + high_value: float = 0.0 + low_value: float = 0.0 + relative_account_drawdown: float = 0.0 def calc_max_drawdown( diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index c949caea4..4f60e3049 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -596,7 +596,7 @@ class RPC: expectancy, expectancy_ratio = calculate_expectancy(trades_df) - drawdown = DrawDownResult(0.0, 0.0, None, None, 0.0) + drawdown = DrawDownResult() if len(trades_df) > 0: try: drawdown = calc_max_drawdown(