fix: add total_pnl to stats API top-level response

This commit is contained in:
root 2026-03-01 01:42:39 +00:00
parent bda42e669a
commit 77d38c7269

View File

@ -778,6 +778,7 @@ async def paper_stats(user: dict = Depends(get_current_user)):
"win_loss_ratio": round(win_loss_ratio, 2), "win_loss_ratio": round(win_loss_ratio, 2),
"mdd": round(mdd, 2), "mdd": round(mdd, 2),
"sharpe": round(sharpe, 2), "sharpe": round(sharpe, 2),
"total_pnl": round(sum(r["pnl_r"] for r in rows), 2),
"long_win_rate": round(long_wr, 1), "long_win_rate": round(long_wr, 1),
"long_count": len(longs), "long_count": len(longs),
"short_win_rate": round(short_wr, 1), "short_win_rate": round(short_wr, 1),