From b08a93a287492550274722cdac1aae3eeeb74693 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 23 Dec 2024 15:49:47 +0100 Subject: [PATCH] feat: Detect both .json and .zip backtest results --- freqtrade/data/btanalysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/data/btanalysis.py b/freqtrade/data/btanalysis.py index 09045528f..0595fa8e2 100644 --- a/freqtrade/data/btanalysis.py +++ b/freqtrade/data/btanalysis.py @@ -211,8 +211,10 @@ def load_and_merge_backtest_result(strategy_name: str, filename: Path, results: def _get_backtest_files(dirname: Path) -> list[Path]: - # Weird glob expression here avoids including .meta.json files. - return list(reversed(sorted(dirname.glob("backtest-result-*-[0-9][0-9].json")))) + # Get both json and zip files separately and combine the results + json_files = dirname.glob("backtest-result-*-[0-9][0-9]*.json") + zip_files = dirname.glob("backtest-result-*-[0-9][0-9]*.zip") + return list(reversed(sorted(list(json_files) + list(zip_files)))) def _extract_backtest_result(filename: Path) -> list[BacktestHistoryEntryType]: