From f63a3789672b7a5e58ce264688e26f895f26d747 Mon Sep 17 00:00:00 2001 From: Allen Day Date: Mon, 7 Sep 2020 23:26:55 +0800 Subject: [PATCH 1/3] Update hyperopt.py zero pad wins/draws/losses (W/D/L) column to preserve alignment in console pretty print --- freqtrade/optimize/hyperopt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index b9db3c09a..6d29be08e 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -574,7 +574,7 @@ class Hyperopt: 'wins': wins, 'draws': draws, 'losses': losses, - 'winsdrawslosses': f"{wins}/{draws}/{losses}", + 'winsdrawslosses': f"{wins:04}/{draws:04}/{losses:04}", 'avg_profit': backtesting_results.profit_percent.mean() * 100.0, 'median_profit': backtesting_results.profit_percent.median() * 100.0, 'total_profit': backtesting_results.profit_abs.sum(), From 3fe2ed0e189a2843c570e84395aea3c99e5b8af8 Mon Sep 17 00:00:00 2001 From: Allen Day Date: Mon, 7 Sep 2020 23:38:51 +0800 Subject: [PATCH 2/3] zero pad in test --- tests/optimize/test_hyperopt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index bb6f043e7..e7a26cd5f 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -813,7 +813,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None: 'draws': 0, 'duration': 100.0, 'losses': 0, - 'winsdrawslosses': '1/0/0', + 'winsdrawslosses': '0001/0000/0000', 'median_profit': 2.3117, 'profit': 2.3117, 'total_profit': 0.000233, From f0d7f18cf98c9ebd6d2b381fd9e092cb824f47af Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 19 Sep 2020 17:32:22 +0200 Subject: [PATCH 3/3] Pad wins / draws / losses for hyperopt with spaces instead of 0's --- freqtrade/optimize/hyperopt.py | 7 ++++--- tests/optimize/test_hyperopt.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 6d29be08e..37de3bc4b 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -324,8 +324,9 @@ class Hyperopt: 'results_metrics.avg_profit', 'results_metrics.total_profit', 'results_metrics.profit', 'results_metrics.duration', 'loss', 'is_initial_point', 'is_best']] - trials.columns = ['Best', 'Epoch', 'Trades', 'W/D/L', 'Avg profit', 'Total profit', - 'Profit', 'Avg duration', 'Objective', 'is_initial_point', 'is_best'] + trials.columns = ['Best', 'Epoch', 'Trades', ' Win Draw Loss', 'Avg profit', + 'Total profit', 'Profit', 'Avg duration', 'Objective', + 'is_initial_point', 'is_best'] trials['is_profit'] = False trials.loc[trials['is_initial_point'], 'Best'] = '* ' trials.loc[trials['is_best'], 'Best'] = 'Best' @@ -574,7 +575,7 @@ class Hyperopt: 'wins': wins, 'draws': draws, 'losses': losses, - 'winsdrawslosses': f"{wins:04}/{draws:04}/{losses:04}", + 'winsdrawslosses': f"{wins:>4} {draws:>4} {losses:>4}", 'avg_profit': backtesting_results.profit_percent.mean() * 100.0, 'median_profit': backtesting_results.profit_percent.median() * 100.0, 'total_profit': backtesting_results.profit_abs.sum(), diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index e7a26cd5f..d58b91209 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -813,7 +813,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None: 'draws': 0, 'duration': 100.0, 'losses': 0, - 'winsdrawslosses': '0001/0000/0000', + 'winsdrawslosses': ' 1 0 0', 'median_profit': 2.3117, 'profit': 2.3117, 'total_profit': 0.000233,