Keep negative and DLL-locked accounts out of the payout histogram
The payout calendar projects accounts still on the winning path, so the daysHist now skips accounts below their starting balance or flipped to liquidate-only, alongside the dead ones the report already drops. They still count in the slice totals — only the calendar stops seeing them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
6c501d00ed
commit
abfb703f0e
+5
-2
@@ -83,11 +83,14 @@ function collectFirmStats() {
|
||||
// Same combined-day view as the trade path: for a combining firm,
|
||||
// "today" spans the holiday stretch. Computed for every live
|
||||
// account — including ones mid-trade — so the days-traded
|
||||
// histogram below covers the whole slice.
|
||||
// histogram below covers the whole slice. Accounts in the red or
|
||||
// DLL-locked stay OUT of the histogram: the payout calendar
|
||||
// projects from "on the winning path", which they are not.
|
||||
// (Dead accounts never reach here — the auto-liq check above.)
|
||||
const combined = cfg ? combineCmeSessions(
|
||||
cfg.combineCmeHolidays, client.dailyPnL[acc.id] ?? [], currentTradeDateCT(), cash.realizedPnL,
|
||||
) : null;
|
||||
if (combined) {
|
||||
if (cfg && combined && acc.active && cash.amount - cfg.accountSize >= 0) {
|
||||
const hist = (slice.daysHist ??= {});
|
||||
hist[combined.daysTraded] = (hist[combined.daysTraded] ?? 0) + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user