Add initial funds to fleet stats and color total PnL.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -79,6 +79,14 @@ def build_stats_summary(db: Any | None = None) -> dict[str, Any]:
|
||||
except Exception:
|
||||
latest_funds = 0.0
|
||||
|
||||
try:
|
||||
initial_funds = float(
|
||||
database.get_setting("initial_equity", str(s.initial_equity))
|
||||
or s.initial_equity
|
||||
)
|
||||
except Exception:
|
||||
initial_funds = float(s.initial_equity)
|
||||
|
||||
return {
|
||||
"mode": mode,
|
||||
"show_slip": mode == "SIM",
|
||||
@@ -92,6 +100,7 @@ def build_stats_summary(db: Any | None = None) -> dict[str, Any]:
|
||||
"total_slip": total_slip if mode == "SIM" else 0.0,
|
||||
"close_reasons": reasons,
|
||||
"equity_curve": curve,
|
||||
"initial_funds": initial_funds,
|
||||
"latest_funds": latest_funds,
|
||||
"max_single_loss": max_single_loss,
|
||||
"loss_streak": _current_loss_streak(curve),
|
||||
|
||||
Reference in New Issue
Block a user