Fix hyperopt-loss interface to enforce kwargs

This commit is contained in:
Matthias
2022-04-25 11:33:18 +02:00
parent 5ff2261b74
commit 4444259078
2 changed files with 5 additions and 6 deletions

View File

@@ -19,11 +19,11 @@ class IHyperOptLoss(ABC):
@staticmethod
@abstractmethod
def hyperopt_loss_function(results: DataFrame, trade_count: int,
def hyperopt_loss_function(*, results: DataFrame, trade_count: int,
min_date: datetime, max_date: datetime,
config: Dict, processed: Dict[str, DataFrame],
backtest_stats: Dict[str, Any],
*args, **kwargs) -> float:
**kwargs) -> float:
"""
Objective function, returns smaller number for better results
"""