From 4e2ccfc091bfe9119b336da246a8a3fd31c7f433 Mon Sep 17 00:00:00 2001 From: Ali Salama Date: Fri, 25 Apr 2025 15:50:56 +0100 Subject: [PATCH] Added use_parallel_download command line option --- freqtrade/commands/arguments.py | 1 + freqtrade/commands/cli_options.py | 5 +++++ freqtrade/configuration/configuration.py | 1 + freqtrade/data/history/history_utils.py | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index c42e46711..ca98b08ca 100755 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -156,6 +156,7 @@ ARGS_DOWNLOAD_DATA = [ "days", "new_pairs_days", "include_inactive", + "use_parallel_download", "timerange", "download_trades", "convert_trades", diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 9620be7ab..c4599cb10 100755 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -436,6 +436,11 @@ AVAILABLE_CLI_OPTIONS = { help="Also download data from inactive pairs.", action="store_true", ), + "use_parallel_download": Arg( + "--use-parallel-download", + help="Use the Parallel Downloader.", + action="store_true", + ), "new_pairs_days": Arg( "--new-pairs-days", help="Download data of new pairs for given number of days. Default: `%(default)s`.", diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 11aff879f..b6a0a2f12 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -377,6 +377,7 @@ class Configuration: ("timeframes", "timeframes --timeframes: {}"), ("days", "Detected --days: {}"), ("include_inactive", "Detected --include-inactive-pairs: {}"), + ("use_parallel_download", "Detected --use-parallel-download: {}"), ("download_trades", "Detected --dl-trades: {}"), ("convert_trades", "Detected --convert: {} - Converting Trade data to OHCV {}"), ("dataformat_ohlcv", 'Using "{}" to store OHLCV data.'), diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 629d1cf7c..4ecf689e7 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -359,6 +359,7 @@ def refresh_backtest_ohlcv_data( data_format: str | None = None, prepend: bool = False, progress_tracker: CustomProgress | None = None, + use_parallel_download: bool = False, ) -> list[str]: """ Refresh stored ohlcv data for backtesting and hyperopt operations. @@ -387,7 +388,7 @@ def refresh_backtest_ohlcv_data( for timeframe in timeframes: # Get fast candles via parallel method on first loop through per timeframe # and candle type. Downloads all the pairs in the list and stores them. - if ( + if use_parallel_download and ( ((pair, timeframe, candle_type) not in fast_candles) and (erase is False) and (prepend is False) @@ -785,6 +786,7 @@ def download_data( trading_mode=config.get("trading_mode", "spot"), prepend=config.get("prepend_data", False), progress_tracker=progress_tracker, + use_parallel_download=config.get("use_parallel_download", False), ) finally: if pairs_not_available: