Reporter: per-day target-hit counts for each account type
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1d4d45bd79
commit
a47a86a59c
@@ -103,6 +103,15 @@ 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.
|
||||
const dayOn = combined
|
||||
? combined.dailyPnL.filter((d) => d.pnl !== 0 && d.date !== combined.tradeDate).length + 1
|
||||
: null;
|
||||
const dayEntry = dayOn === null ? null : ((slice.dayStats ??= {})[dayOn] ??= { total: 0, targetHit: 0 });
|
||||
if (dayEntry) dayEntry.total++;
|
||||
|
||||
if (cfg && combined && acc.active && cash.amount - cfg.accountSize >= 0) {
|
||||
const hist = (slice.daysHist ??= {});
|
||||
hist[combined.daysTraded] = (hist[combined.daysTraded] ?? 0) + 1;
|
||||
@@ -241,6 +250,7 @@ function collectFirmStats() {
|
||||
} else if (targetHit) {
|
||||
targetHitCount++;
|
||||
slice.targetHit = (slice.targetHit ?? 0) + 1;
|
||||
if (dayEntry) dayEntry.targetHit++;
|
||||
} else {
|
||||
partialCount++;
|
||||
slice.partial = (slice.partial ?? 0) + 1;
|
||||
|
||||
Reference in New Issue
Block a user