chore: simplify usage of data_pickle_file
This commit is contained in:
@@ -94,8 +94,7 @@ class Hyperopt:
|
|||||||
self.hyperopt_table_header = 0
|
self.hyperopt_table_header = 0
|
||||||
self.print_json = self.config.get("print_json", False)
|
self.print_json = self.config.get("print_json", False)
|
||||||
|
|
||||||
self.hyperopter = HyperOptimizer(self.config)
|
self.hyperopter = HyperOptimizer(self.config, self.data_pickle_file)
|
||||||
self.hyperopter.data_pickle_file = self.data_pickle_file
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_lock_filename(config: Config) -> str:
|
def get_lock_filename(config: Config) -> str:
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class HyperOptimizer:
|
|||||||
This class is sent to the hyperopt worker processes.
|
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.buy_space: list[DimensionProtocol] = []
|
||||||
self.sell_space: list[DimensionProtocol] = []
|
self.sell_space: list[DimensionProtocol] = []
|
||||||
self.protection_space: list[DimensionProtocol] = []
|
self.protection_space: list[DimensionProtocol] = []
|
||||||
@@ -106,8 +106,10 @@ class HyperOptimizer:
|
|||||||
self.config
|
self.config
|
||||||
)
|
)
|
||||||
self.calculate_loss = self.custom_hyperoptloss.hyperopt_loss_function
|
self.calculate_loss = self.custom_hyperoptloss.hyperopt_loss_function
|
||||||
|
|
||||||
|
self.data_pickle_file = data_pickle_file
|
||||||
|
|
||||||
self.market_change = 0.0
|
self.market_change = 0.0
|
||||||
self.data_pickle_file = ""
|
|
||||||
|
|
||||||
if HyperoptTools.has_space(self.config, "sell"):
|
if HyperoptTools.has_space(self.config, "sell"):
|
||||||
# Make sure use_exit_signal is enabled
|
# Make sure use_exit_signal is enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user