fix Hyperopt-list avg-time filters

These should use a numeric field (which currently isn't available).

closes #5061
This commit is contained in:
Matthias
2021-05-31 20:00:47 +02:00
parent 2f816dff9b
commit f920c26802
4 changed files with 31 additions and 13 deletions

View File

@@ -197,8 +197,12 @@ def _hyperopt_filter_epochs_duration(epochs: List, filteroptions: dict) -> List:
return x['results_metrics']['duration']
else:
# New mode
avg = x['results_metrics']['holding_avg']
return avg.total_seconds() // 60
if 'holding_avg_s' in x['results_metrics']:
avg = x['results_metrics']['holding_avg_s']
return avg // 60
raise OperationalException(
"Holding-average not available. Please omit the filter on average time, "
"or rerun hyperopt with this version")
if filteroptions['filter_min_avg_time'] is not None:
epochs = _hyperopt_filter_epochs_trade(epochs, 0)