Improve formatting of result string to be a bit conciser

This commit is contained in:
Matthias 2020-08-14 07:31:14 +02:00
parent d76ee43246
commit b98107375e
2 changed files with 3 additions and 4 deletions

View File

@ -585,9 +585,8 @@ class Hyperopt:
"""
stake_cur = self.config['stake_currency']
return (f"{results_metrics['trade_count']:6d} trades. "
f"{results_metrics['wins']:6d} wins. "
f"{results_metrics['draws']:6d} draws. "
f"{results_metrics['losses']:6d} losses. "
f"{results_metrics['wins']}/{results_metrics['draws']}"
f"/{results_metrics['losses']} Wins/Draws/Losses. "
f"Avg profit {results_metrics['avg_profit']: 6.2f}%. "
f"Median profit {results_metrics['median_profit']: 6.2f}%. "
f"Total profit {results_metrics['total_profit']: 11.8f} {stake_cur} "

View File

@ -744,7 +744,7 @@ def test_generate_optimizer(mocker, default_conf) -> None:
}
response_expected = {
'loss': 1.9840569076926293,
'results_explanation': (' 1 trades. 1 wins. 0 draws. 0 losses. '
'results_explanation': (' 1 trades. 1/0/0 Wins/Draws/Losses. '
'Avg profit 2.31%. Median profit 2.31%. Total profit '
'0.00023300 BTC ( 2.31\N{GREEK CAPITAL LETTER SIGMA}%). '
'Avg duration 100.0 min.'