From 549b0f8ef4ea98d5a54b479a36e9907df0e19a05 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 19 Oct 2024 12:33:42 +0200 Subject: [PATCH] feat: delete all files when deleting a backtest result --- freqtrade/data/btanalysis.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/freqtrade/data/btanalysis.py b/freqtrade/data/btanalysis.py index 4cf748d04..7e4d02f75 100644 --- a/freqtrade/data/btanalysis.py +++ b/freqtrade/data/btanalysis.py @@ -244,11 +244,10 @@ def delete_backtest_result(file_abs: Path): """ # *.meta.json logger.info(f"Deleting backtest result file: {file_abs.name}") - file_abs_meta = file_abs.with_suffix(".meta.json") - file_abs_market_change = file_abs.with_name(file_abs.stem + "_market_change.feather") - file_abs.unlink() - file_abs_meta.unlink() - file_abs_market_change.unlink() + + for file in file_abs.parent.glob(f"{file_abs.stem}*"): + logger.info(f"Deleting file: {file}") + file.unlink() def update_backtest_metadata(filename: Path, strategy: str, content: dict[str, Any]):