chore: simplify usage of data_pickle_file

This commit is contained in:
Matthias
2025-04-23 19:43:10 +02:00
parent 9b08b51ad8
commit 2abf22e37b
2 changed files with 5 additions and 4 deletions

View File

@@ -94,8 +94,7 @@ class Hyperopt:
self.hyperopt_table_header = 0
self.print_json = self.config.get("print_json", False)
self.hyperopter = HyperOptimizer(self.config)
self.hyperopter.data_pickle_file = self.data_pickle_file
self.hyperopter = HyperOptimizer(self.config, self.data_pickle_file)
@staticmethod
def get_lock_filename(config: Config) -> str:

View File

@@ -70,7 +70,7 @@ class HyperOptimizer:
This class is sent to the hyperopt worker processes.
"""
def __init__(self, config: Config) -> None:
def __init__(self, config: Config, data_pickle_file: Path) -> None:
self.buy_space: list[DimensionProtocol] = []
self.sell_space: list[DimensionProtocol] = []
self.protection_space: list[DimensionProtocol] = []
@@ -106,8 +106,10 @@ class HyperOptimizer:
self.config
)
self.calculate_loss = self.custom_hyperoptloss.hyperopt_loss_function
self.data_pickle_file = data_pickle_file
self.market_change = 0.0
self.data_pickle_file = ""
if HyperoptTools.has_space(self.config, "sell"):
# Make sure use_exit_signal is enabled