Add relevant metrics to backtest breakdowns (fix 3)

This commit is contained in:
mrpabloyeah
2025-03-16 14:17:40 +01:00
parent 51a99f2a66
commit a47ed1dbdb
3 changed files with 5 additions and 5 deletions

View File

@@ -140,10 +140,10 @@ def text_table_periodic_breakdown(
output = [
[
d["date"],
d["trades"],
d.get('trades', 'N/A'),
fmt_coin(d["profit_abs"], stake_currency, False),
d["profit_factor"],
generate_wins_draws_losses(d["wins"], d["draws"], d["losses"]),
d.get('profit_factor', 'N/A'),
generate_wins_draws_losses(d["wins"], d["draws"], d['loses']),
]
for d in days_breakdown_stats
]

View File

@@ -243,7 +243,7 @@ def generate_periodic_breakdown_stats(
"profit_abs": profit_abs,
"wins": wins,
"draws": draws,
"losses": losses,
"loses": losses,
"trades": trades,
"profit_factor": round(profit_factor, 2),
}

View File

@@ -587,7 +587,7 @@ def test_generate_periodic_breakdown_stats(testdatadir):
day = res[0]
assert "date" in day
assert "draws" in day
assert "losses" in day
assert "loses" in day
assert "wins" in day
assert "profit_abs" in day