From 2496aa8e3f027cfb95a6628204442ca464739121 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 23 Dec 2019 10:59:26 +0100 Subject: [PATCH] Add convert-data template subcommands --- freqtrade/configuration/arguments.py | 13 ++++++++++++- freqtrade/utils.py | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/freqtrade/configuration/arguments.py b/freqtrade/configuration/arguments.py index b2197619d..396b55ef5 100644 --- a/freqtrade/configuration/arguments.py +++ b/freqtrade/configuration/arguments.py @@ -47,6 +47,8 @@ ARGS_BUILD_STRATEGY = ["user_data_dir", "strategy", "template"] ARGS_BUILD_HYPEROPT = ["user_data_dir", "hyperopt", "template"] +ARGS_CONVERT_DATA = [] + ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "download_trades", "exchange", "timeframes", "erase"] @@ -131,7 +133,7 @@ class Arguments: self._build_args(optionlist=['version'], parser=self.parser) from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge - from freqtrade.utils import (start_create_userdir, start_download_data, + from freqtrade.utils import (start_create_userdir, start_convert_data, start_download_data, start_hyperopt_list, start_hyperopt_show, start_list_exchanges, start_list_markets, start_list_strategies, start_new_hyperopt, @@ -251,6 +253,15 @@ class Arguments: download_data_cmd.set_defaults(func=start_download_data) self._build_args(optionlist=ARGS_DOWNLOAD_DATA, parser=download_data_cmd) + # Add convert-data subcommand + convert_data_cmd = subparsers.add_parser( + 'convert-data', + help='Convert data from one format to another.', + parents=[_common_parser], + ) + convert_data_cmd.set_defaults(func=start_convert_data) + self._build_args(optionlist=ARGS_CONVERT_DATA, parser=convert_data_cmd) + # Add Plotting subcommand plot_dataframe_cmd = subparsers.add_parser( 'plot-dataframe', diff --git a/freqtrade/utils.py b/freqtrade/utils.py index 5a5662e4b..59a8dcbb3 100644 --- a/freqtrade/utils.py +++ b/freqtrade/utils.py @@ -241,6 +241,14 @@ def start_list_strategies(args: Dict[str, Any]) -> None: print(tabulate(strats_to_print, headers='keys', tablefmt='pipe')) +def start_convert_data(args: Dict[str, Any]) -> None: + """ + Convert data from one format to another + """ + config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE) + print(config) + + def start_list_timeframes(args: Dict[str, Any]) -> None: """ Print ticker intervals (timeframes) available on Exchange