strategy interface: removed some changes

This commit is contained in:
Sam Germain
2021-08-21 17:06:04 -06:00
parent 314359dd6e
commit a5be535cc9
4 changed files with 5 additions and 13 deletions

View File

@@ -232,10 +232,7 @@ class Backtesting:
pair_data.loc[:, 'buy_tag'] = None # cleanup if buy_tag is exist
df_analyzed = self.strategy.advise_sell(
self.strategy.advise_buy(
pair_data,
{'pair': pair}
),
self.strategy.advise_buy(pair_data, {'pair': pair}),
{'pair': pair}
).copy()
# Trim startup period from analyzed dataframe

View File

@@ -285,13 +285,11 @@ class Hyperopt:
# Apply parameters
if HyperoptTools.has_space(self.config, 'buy'):
self.backtesting.strategy.advise_buy = ( # type: ignore
self.custom_hyperopt.buy_strategy_generator(params_dict)
)
self.custom_hyperopt.buy_strategy_generator(params_dict))
if HyperoptTools.has_space(self.config, 'sell'):
self.backtesting.strategy.advise_sell = ( # type: ignore
self.custom_hyperopt.sell_strategy_generator(params_dict)
)
self.custom_hyperopt.sell_strategy_generator(params_dict))
if HyperoptTools.has_space(self.config, 'protection'):
for attr_name, attr in self.backtesting.strategy.enumerate_parameters('protection'):