Files
momentum-system/storage
momentum devandClaude Opus 4.8 ea414e2822 Dashboard: broker-authoritative session P&L (web strip read $0 on a losing day)
query_session_pnl reconstructed realized P&L solely from position_closed events
— of which the store has ZERO — so the web P&L strip showed $0 / no trades during
the real -$2,322 day while broker equity actually fell ~$11k peak-to-trough. The
operator flew blind.

Now prefer the broker equity delta: day P&L = latest account_summary equity -
prior-session close (last_equity); matched (realized) = day P&L - current
unrealized. Falls back to the closed-event sum when no equity snapshot exists.
Adds broker_day_pnl + pnl_source to the payload; existing frontend keys
unchanged. Verified live: total_pnl now reads the real -$1,840 (was $0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 18:46:02 -04:00
..