Reporter: day stats keyed by Days Traded, matching the instance dashboard

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-23 20:16:28 -05:00
co-authored by Claude Opus 5.5
parent a7e01b0138
commit dd73222e00
2 changed files with 10 additions and 6 deletions
+7 -4
View File
@@ -123,11 +123,14 @@ function collectFirmStats() {
cfg.targetSameEquity, cfg.withdrawalStages,
client.priorProfit?.[acc.id] ?? 0, fundTxns, cfg.minDayPnL,
) : null;
// The day this account is on today, for the master's per-day pass
// counts. Days before today's trade date only, so it reads the
// same before and after today's P&L books.
// Days traded, for the master's per-day pass counts — the same
// number as the local dashboard's Days Traded column
// (app/api/state): only days reaching minDayPnL when it is set,
// today included once it books.
const dayOn = combined
? combined.dailyPnL.filter((d) => d.pnl !== 0 && d.date !== combined.tradeDate).length + 1
? effective && effective.minDayPnL > 0
? combined.dailyPnL.filter((d) => d.pnl >= effective.minDayPnL).length
: combined.daysTraded
: null;
const dayEntry = dayOn === null ? null : ((slice.dayStats ??= {})[dayOn] ??= { total: 0, targetHit: 0 });
if (dayEntry) dayEntry.total++;