Aggregate the top status cards across strategies
With several strategies the header cards showed only the first one. Expose day_pnl and drawdown_pct per strategy and add aggregateStatus() (frontend) so the cards show the whole account: summed cash/equity/P&L/trades/positions, worst drawdown, and any halt. Single-strategy runs are unchanged. Adds tests.
This commit is contained in:
1 parent
657c473e82
commit
57dcfe7adb
6 files changed
+133
-3
No files matched your search
@@ -158,6 +158,8 @@ class MultiStrategyManager:
|
||||
halted=engine_status.halted,
|
||||
halt_reason=engine_status.halt_reason,
|
||||
trades_today=engine_status.trades_today,
|
||||
day_pnl=engine_status.day_pnl,
|
||||
drawdown_pct=engine_status.drawdown_pct,
|
||||
error=engine_status.error,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -177,6 +177,8 @@ class StrategyStatusOut(BaseModel):
|
||||
halted: bool = False
|
||||
halt_reason: str | None = None
|
||||
trades_today: int = 0
|
||||
day_pnl: float = 0.0
|
||||
drawdown_pct: float = 0.0
|
||||
error: str | None = None
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user