mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Use default parameters for DrawdownResult
This commit is contained in:
parent
94786454b7
commit
bcb59265b5
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user