Fix protections being loaded multiple times for first strategy when backtesting.

This commit is contained in:
Rokas Kupstys
2021-05-13 11:49:12 +03:00
parent 29fed37df3
commit 2d5f465f1b
4 changed files with 18 additions and 2 deletions

View File

@@ -115,8 +115,6 @@ class Backtesting:
# Get maximum required startup period
self.required_startup = max([strat.startup_candle_count for strat in self.strategylist])
# Load one (first) strategy
self._set_strategy(self.strategylist[0])
def __del__(self):
LoggingMixin.show_output = True

View File

@@ -79,6 +79,7 @@ class Hyperopt:
self.custom_hyperopt = HyperOptAuto(self.config)
else:
self.custom_hyperopt = HyperOptResolver.load_hyperopt(self.config)
self.backtesting._set_strategy(self.backtesting.strategylist[0])
self.custom_hyperopt.strategy = self.backtesting.strategy
self.custom_hyperoptloss = HyperOptLossResolver.load_hyperoptloss(self.config)