chore: Fix test failure, sort imports

This commit is contained in:
Matthias 2024-10-19 13:02:27 +02:00
parent 78bf40eaa9
commit 660af7ec70

View File

@ -19,14 +19,15 @@ Possible to change:
from datetime import datetime
from typing import Any, Dict
import numpy as np
import numpy as np
from pandas import DataFrame
from freqtrade.constants import Config
from freqtrade.data.metrics import calculate_max_drawdown, calculate_expectancy
from freqtrade.data.metrics import calculate_expectancy, calculate_max_drawdown
from freqtrade.optimize.hyperopt import IHyperOptLoss
# smaller numbers penalize drawdowns more severely
DRAWDOWN_MULT = 0.055
# A very large number to use as a replacement for infinity
@ -44,7 +45,6 @@ WINRATE_CONST = 1.2
class MultiMetricHyperOptLoss(IHyperOptLoss):
@staticmethod
def hyperopt_loss_function(
*,
results: DataFrame,
trade_count: int,
min_date: datetime,
@ -99,4 +99,4 @@ class MultiMetricHyperOptLoss(IHyperOptLoss):
* log_expectancy_ratio
* log_winrate_coef
* trade_count_penalty
)
)