feat: display min/max balance

This commit is contained in:
Matthias
2025-11-16 10:11:56 +01:00
parent 680aeb89c3
commit 1ede186484
@@ -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%}"),
]