diff --git a/docs/utils.md b/docs/utils.md index dd7a9dfe3..eb71c509c 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -429,6 +429,7 @@ usage: freqtrade hyperopt-list [-h] [-v] [--logfile FILE] [-V] [-c PATH] [--min-total-profit FLOAT] [--max-total-profit FLOAT] [--no-color] [--print-json] [--no-details] + [--export-csv FILE] optional arguments: -h, --help show this help message and exit @@ -450,9 +451,8 @@ optional arguments: useful if you are redirecting output to a file. --print-json Print best result detailization in JSON format. --no-details Do not print best epoch details. - --export-csv FILE Export to CSV-File. Put + in front of filename to - overwrite. This will disable table print. Example: - --export-csv +hyperopt.csv + --export-csv FILE Export to CSV-File. This will disable table print. + Example: --export-csv hyperopt.csv Common arguments: -v, --verbose Verbose mode (-vv for more, -vvv to get all messages). @@ -461,9 +461,10 @@ Common arguments: details. -V, --version show program's version number and exit -c PATH, --config PATH - Specify configuration file (default: `config.json`). - Multiple --config options may be used. Can be set to - `-` to read config from stdin. + Specify configuration file (default: + `userdir/config.json` or `config.json` whichever + exists). Multiple --config options may be used. Can be + set to `-` to read config from stdin. -d PATH, --datadir PATH Path to directory with historical backtesting data. --userdir PATH, --user-data-dir PATH diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index b782c2fb9..8548bd887 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -223,9 +223,9 @@ AVAILABLE_CLI_OPTIONS = { ), "export_csv": Arg( '--export-csv', - help='Export to CSV-File. Put + in front of filename to overwrite.' + help='Export to CSV-File.' ' This will disable table print.' - ' Example: --export-csv +hyperopt.csv', + ' Example: --export-csv hyperopt.csv', metavar='FILE', ), "hyperopt_jobs": Arg( diff --git a/freqtrade/commands/hyperopt_commands.py b/freqtrade/commands/hyperopt_commands.py index efc9aba88..5b2388252 100755 --- a/freqtrade/commands/hyperopt_commands.py +++ b/freqtrade/commands/hyperopt_commands.py @@ -63,14 +63,8 @@ def start_hyperopt_list(args: Dict[str, Any]) -> None: Hyperopt.print_epoch_details(results, total_epochs, print_json, no_header) if trials and export_csv: - overwrite_csv = False - if export_csv[0] == '+': - overwrite_csv = True - export_csv = export_csv[1:] - Hyperopt.export_csv_file( - config, trials, total_epochs, - not filteroptions['only_best'], export_csv, overwrite_csv + config, trials, total_epochs, not filteroptions['only_best'], export_csv ) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index d12e9cd45..8e0eba4d7 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -385,7 +385,7 @@ class Hyperopt: @staticmethod def export_csv_file(config: dict, results: list, total_epochs: int, highlight_best: bool, - csv_file: str, overwrite: bool) -> None: + csv_file: str) -> None: """ Log result to csv-file """ @@ -393,8 +393,8 @@ class Hyperopt: return # Verification for overwrite - if not overwrite and path.isfile(csv_file): - logging.error("CSV-File already exists and no overwrite specified!") + if path.isfile(csv_file): + logging.error("CSV-File already exists!") return try: diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index f404a4671..4530cd03d 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -905,7 +905,7 @@ def test_hyperopt_list(mocker, capsys, hyperopt_results): args = [ "hyperopt-list", "--no-details", - "--export-csv", "+test_file.csv" + "--export-csv", "test_file.csv" ] pargs = get_args(args) pargs['config'] = None