Calculate and save all metrics per pair (fix 2)

This commit is contained in:
mrpabloyeah
2025-03-25 20:24:29 +01:00
parent be40e828a9
commit 20325a2b5e

View File

@@ -88,11 +88,13 @@ def _generate_result_line(
winning_profit = result.loc[result["profit_abs"] > 0, "profit_abs"].sum()
losing_profit = result.loc[result["profit_abs"] < 0, "profit_abs"].sum()
profit_factor = winning_profit / abs(losing_profit) if losing_profit else 0.0
try:
drawdown = calculate_max_drawdown(
result, value_col="profit_abs", starting_balance=starting_balance
)
except:
except ValueError:
drawdown = None
return {