diff --git a/.gitattributes b/.gitattributes index 00abd1d9d..81f6f422e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -*.py eol=lf -*.sh eol=lf -*.ps1 eol=crlf +*.py eol=lf +*.sh eol=lf +*.ps1 eol=crlf diff --git a/docs/advanced-hyperopt.md b/docs/advanced-hyperopt.md index c86978b80..35fd3de4a 100644 --- a/docs/advanced-hyperopt.md +++ b/docs/advanced-hyperopt.md @@ -289,7 +289,7 @@ Given the following result from hyperopt: ``` Best result: - 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367 + 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722%). Avg duration 180.4 mins. Objective: 1.94367 Buy hyperspace params: { 'adx-value': 44, diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 0d7b1cc32..dfee27fa2 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -491,7 +491,7 @@ Given the following result from hyperopt: ``` Best result: - 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367 + 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722%). Avg duration 180.4 mins. Objective: 1.94367 # Buy hyperspace params: buy_params = { @@ -532,7 +532,7 @@ If you are optimizing ROI (i.e. if optimization search-space contains 'all', 'de ``` Best result: - 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367 + 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722%). Avg duration 180.4 mins. Objective: 1.94367 # ROI table: minimal_roi = { @@ -587,7 +587,7 @@ If you are optimizing stoploss values (i.e. if optimization search-space contain ``` Best result: - 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367 + 44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722%). Avg duration 180.4 mins. Objective: 1.94367 # Buy hyperspace params: buy_params = { @@ -629,7 +629,7 @@ If you are optimizing trailing stop values (i.e. if optimization search-space co ``` Best result: - 45/100: 606 trades. Avg profit 1.04%. Total profit 0.31555614 BTC ( 630.48Σ%). Avg duration 150.3 mins. Objective: -1.10161 + 45/100: 606 trades. Avg profit 1.04%. Total profit 0.31555614 BTC ( 630.48%). Avg duration 150.3 mins. Objective: -1.10161 # Trailing stop: trailing_stop = True diff --git a/freqtrade/optimize/hyperopt_tools.py b/freqtrade/optimize/hyperopt_tools.py index 38cb0854e..ebe405d07 100644 --- a/freqtrade/optimize/hyperopt_tools.py +++ b/freqtrade/optimize/hyperopt_tools.py @@ -1,6 +1,5 @@ import io -import locale import logging from collections import OrderedDict from pathlib import Path @@ -195,9 +194,9 @@ class HyperoptTools(): f"Avg profit {results_metrics['profit_mean'] * 100: 6.2f}%. " f"Median profit {results_metrics['profit_median'] * 100: 6.2f}%. " f"Total profit {results_metrics['profit_total_abs']: 11.8f} {stake_currency} " - f"({results_metrics['profit_total'] * 100: 7.2f}\N{GREEK CAPITAL LETTER SIGMA}%). " + f"({results_metrics['profit_total'] * 100: 7.2f}%). " f"Avg duration {results_metrics['holding_avg']} min." - ).encode(locale.getpreferredencoding(), 'replace').decode('utf-8') + ) @staticmethod def _format_explanation_string(results, total_epochs) -> str: diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index d7eb8bf67..07d208210 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -1,5 +1,4 @@ # pragma pylint: disable=missing-docstring,W0212,C0103 -import locale import logging import re from datetime import datetime @@ -640,9 +639,9 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None: 'loss': 1.9147239021396234, 'results_explanation': (' 4 trades. 4/0/0 Wins/Draws/Losses. ' 'Avg profit 0.77%. Median profit 0.71%. Total profit ' - '0.00003100 BTC ( 0.00\N{GREEK CAPITAL LETTER SIGMA}%). ' + '0.00003100 BTC ( 0.00%). ' 'Avg duration 0:50:00 min.' - ).encode(locale.getpreferredencoding(), 'replace').decode('utf-8'), + ), 'params_details': {'buy': {'adx-enabled': False, 'adx-value': 0, 'fastd-enabled': True,