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
@@ -23,8 +23,10 @@ export interface AccountTypeStats {
|
|||||||
partial?: number;
|
partial?: number;
|
||||||
loss?: number;
|
loss?: number;
|
||||||
/** Live accounts by trading days completed toward the current target:
|
/** Live accounts by trading days completed toward the current target:
|
||||||
* {daysTraded: accountCount}. Feeds the master's payout calendar.
|
* {daysTraded: accountCount}. Feeds the master's payout calendar, so
|
||||||
* Optional so an older master simply ignores it. */
|
* accounts that are dead, DLL-locked, or in the red are left out — the
|
||||||
|
* calendar only projects accounts still on the winning path. Optional so
|
||||||
|
* an older master simply ignores it. */
|
||||||
daysHist?: Record<number, number>;
|
daysHist?: Record<number, number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -83,11 +83,14 @@ function collectFirmStats() {
|
|||||||
// Same combined-day view as the trade path: for a combining firm,
|
// Same combined-day view as the trade path: for a combining firm,
|
||||||
// "today" spans the holiday stretch. Computed for every live
|
// "today" spans the holiday stretch. Computed for every live
|
||||||
// account — including ones mid-trade — so the days-traded
|
// 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(
|
const combined = cfg ? combineCmeSessions(
|
||||||
cfg.combineCmeHolidays, client.dailyPnL[acc.id] ?? [], currentTradeDateCT(), cash.realizedPnL,
|
cfg.combineCmeHolidays, client.dailyPnL[acc.id] ?? [], currentTradeDateCT(), cash.realizedPnL,
|
||||||
) : null;
|
) : null;
|
||||||
if (combined) {
|
if (cfg && combined && acc.active && cash.amount - cfg.accountSize >= 0) {
|
||||||
const hist = (slice.daysHist ??= {});
|
const hist = (slice.daysHist ??= {});
|
||||||
hist[combined.daysTraded] = (hist[combined.daysTraded] ?? 0) + 1;
|
hist[combined.daysTraded] = (hist[combined.daysTraded] ?? 0) + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user