From 1ede18648433ab786ee845664437b8726b361ef7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 16 Nov 2025 10:11:56 +0100 Subject: [PATCH] feat: display min/max balance --- .../optimize/optimize_reports/bt_output.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/optimize_reports/bt_output.py b/freqtrade/optimize/optimize_reports/bt_output.py index 338fe5ca5..026052ae6 100644 --- a/freqtrade/optimize/optimize_reports/bt_output.py +++ b/freqtrade/optimize/optimize_reports/bt_output.py @@ -288,6 +288,24 @@ def text_table_add_metrics(strat_results: dict) -> None: else [] ) + if wallet_stats := strat_results.get("wallet_stats"): + wallet_metrics = ( + ( + "Min/Max balance realized", + f"{fmt_coin(strat_results['csum_min'], stake)} / " + f"{fmt_coin(strat_results['csum_max'], stake)}", + ), + ( + "Min/Max balance unrealized", + f"{fmt_coin(wallet_stats['low_balance'], stake)} / " + f"{fmt_coin(wallet_stats['high_balance'], stake)}", + ), + ( + "Min/Max balance dates", + f"{wallet_stats['low_date']} / {wallet_stats['high_date']}", + ), + ) + # Newly added fields should be ignored if they are missing in strat_results. hyperopt-show # command stores these results and newer version of freqtrade must be able to handle old # results with missing new fields. @@ -408,8 +426,7 @@ def text_table_add_metrics(strat_results: dict) -> None: ), *entry_adjustment_metrics, ("", ""), # Empty line to improve readability - ("Min balance", fmt_coin(strat_results["csum_min"], stake)), - ("Max balance", fmt_coin(strat_results["csum_max"], stake)), + *wallet_metrics, *drawdown_metrics, ("Market change", f"{strat_results['market_change']:.2%}"), ]