From c63d0e167cd99146d1529ee2da915cac8ca14790 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 16 Aug 2025 14:04:23 +0200 Subject: [PATCH] chore: switch to using exportdirectory --- freqtrade/commands/optimize_commands.py | 2 +- freqtrade/data/entryexitanalysis.py | 12 ++++++------ freqtrade/optimize/optimize_reports/bt_storage.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/freqtrade/commands/optimize_commands.py b/freqtrade/commands/optimize_commands.py index 5ec3dfe01..9c3a861fd 100644 --- a/freqtrade/commands/optimize_commands.py +++ b/freqtrade/commands/optimize_commands.py @@ -72,7 +72,7 @@ def start_backtesting_show(args: dict[str, Any]) -> None: from freqtrade.data.btanalysis import load_backtest_stats from freqtrade.optimize.optimize_reports import show_backtest_results, show_sorted_pairlist - results = load_backtest_stats(config["exportfilename"]) + results = load_backtest_stats(config["exportdirectory"]) show_backtest_results(config, results) show_sorted_pairlist(config, results) diff --git a/freqtrade/data/entryexitanalysis.py b/freqtrade/data/entryexitanalysis.py index cbd6aae41..aa9a2d028 100644 --- a/freqtrade/data/entryexitanalysis.py +++ b/freqtrade/data/entryexitanalysis.py @@ -330,7 +330,7 @@ def process_entry_exit_reasons(config: Config): do_rejected = config.get("analysis_rejected", False) to_csv = config.get("analysis_to_csv", False) csv_path = Path( - config.get("analysis_csv_path", config["exportfilename"]), # type: ignore[arg-type] + config.get("analysis_csv_path", config["exportdirectory"]), # type: ignore[arg-type] ) if entry_only is True and exit_only is True: @@ -344,21 +344,21 @@ def process_entry_exit_reasons(config: Config): None if config.get("timerange") is None else str(config.get("timerange")) ) try: - backtest_stats = load_backtest_stats(config["exportfilename"]) + backtest_stats = load_backtest_stats(config["exportdirectory"]) except ValueError as e: raise ConfigurationError(e) from e for strategy_name, results in backtest_stats["strategy"].items(): - trades = load_backtest_data(config["exportfilename"], strategy_name) + trades = load_backtest_data(config["exportdirectory"], strategy_name) if trades is not None and not trades.empty: - signal_candles = load_backtest_analysis_data(config["exportfilename"], "signals") - exit_signals = load_backtest_analysis_data(config["exportfilename"], "exited") + signal_candles = load_backtest_analysis_data(config["exportdirectory"], "signals") + exit_signals = load_backtest_analysis_data(config["exportdirectory"], "exited") rej_df = None if do_rejected: rejected_signals_dict = load_backtest_analysis_data( - config["exportfilename"], "rejected" + config["exportdirectory"], "rejected" ) rej_df = prepare_results( rejected_signals_dict, diff --git a/freqtrade/optimize/optimize_reports/bt_storage.py b/freqtrade/optimize/optimize_reports/bt_storage.py index 1e6a67e81..ef73d4721 100644 --- a/freqtrade/optimize/optimize_reports/bt_storage.py +++ b/freqtrade/optimize/optimize_reports/bt_storage.py @@ -64,7 +64,7 @@ def store_backtest_results( :param market_change_data: Dataframe containing market change data :param analysis_results: Dictionary containing analysis results """ - recordfilename: Path = config["exportfilename"] + recordfilename: Path = config["exportdirectory"] zip_filename = _generate_filename(recordfilename, dtappendix, ".zip") base_filename = _generate_filename(recordfilename, dtappendix, "") json_filename = _generate_filename(recordfilename, dtappendix, ".json")