Report per-account-type days-traded histograms to the master
Adds daysHist ({daysTraded: accountCount}) to AccountTypeStats, computed
from the same combined-day view the trade path uses and covering every
live account including ones mid-trade. Feeds the master's payout
calendar; an older master simply ignores the field.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0d01539338
commit
6c501d00ed
+13
-6
@@ -80,6 +80,18 @@ function collectFirmStats() {
|
||||
totalAccounts++;
|
||||
slice.totalAccounts++;
|
||||
|
||||
// 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.
|
||||
const combined = cfg ? combineCmeSessions(
|
||||
cfg.combineCmeHolidays, client.dailyPnL[acc.id] ?? [], currentTradeDateCT(), cash.realizedPnL,
|
||||
) : null;
|
||||
if (combined) {
|
||||
const hist = (slice.daysHist ??= {});
|
||||
hist[combined.daysTraded] = (hist[combined.daysTraded] ?? 0) + 1;
|
||||
}
|
||||
|
||||
if (client.positions[acc.id]) {
|
||||
inTrade++;
|
||||
accountsTraded++;
|
||||
@@ -100,12 +112,7 @@ function collectFirmStats() {
|
||||
}
|
||||
|
||||
// Check if target was hit today
|
||||
if (cfg) {
|
||||
// Same combined-day view as the trade path: for a combining
|
||||
// firm, "today" spans the holiday stretch.
|
||||
const combined = combineCmeSessions(
|
||||
cfg.combineCmeHolidays, client.dailyPnL[acc.id] ?? [], currentTradeDateCT(), cash.realizedPnL,
|
||||
);
|
||||
if (cfg && combined) {
|
||||
const equityProfit = cash.amount - cfg.accountSize;
|
||||
const plan = computeDayPlan(
|
||||
acc.id, combined.tradeDate, cfg.profitTarget, cfg.consistency,
|
||||
|
||||
Reference in New Issue
Block a user