mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
Fix generation of hyperopt trailing params
This commit is contained in:
@@ -177,8 +177,7 @@ class Hyperopt:
|
||||
result['stoploss'] = {p.name: params.get(p.name)
|
||||
for p in self.hyperopt_space('stoploss')}
|
||||
if self.has_space('trailing'):
|
||||
result['trailing'] = {p.name: params.get(p.name)
|
||||
for p in self.hyperopt_space('trailing')}
|
||||
result['trailing'] = self.custom_hyperopt.generate_trailing_params(params)
|
||||
|
||||
return result
|
||||
|
||||
@@ -353,13 +352,13 @@ class Hyperopt:
|
||||
self.backtesting.strategy.stoploss = params_dict['stoploss']
|
||||
|
||||
if self.has_space('trailing'):
|
||||
self.backtesting.strategy.trailing_stop = params_dict['trailing_stop']
|
||||
self.backtesting.strategy.trailing_stop_positive = \
|
||||
params_dict['trailing_stop_positive']
|
||||
d = self.custom_hyperopt.generate_trailing_params(params_dict)
|
||||
self.backtesting.strategy.trailing_stop = d['trailing_stop']
|
||||
self.backtesting.strategy.trailing_stop_positive = d['trailing_stop_positive']
|
||||
self.backtesting.strategy.trailing_stop_positive_offset = \
|
||||
params_dict['trailing_stop_positive_offset']
|
||||
d['trailing_stop_positive_offset']
|
||||
self.backtesting.strategy.trailing_only_offset_is_reached = \
|
||||
params_dict['trailing_only_offset_is_reached']
|
||||
d['trailing_only_offset_is_reached']
|
||||
|
||||
processed = load(self.tickerdata_pickle)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user