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
@@ -31,6 +31,11 @@ export interface AccountTypeStats {
|
|||||||
* calendar only projects accounts still on the winning path. Optional so
|
* calendar only projects accounts still on the winning path. Optional so
|
||||||
* an older master simply ignores it. */
|
* an older master simply ignores it. */
|
||||||
daysHist?: Record<number, number>;
|
daysHist?: Record<number, number>;
|
||||||
|
/** Live accounts by the trading day they are on today (1 = first day of
|
||||||
|
* the current cycle, counting traded days before today's trade date),
|
||||||
|
* with how many of them hit today's target. Lets the master show
|
||||||
|
* "Day 1 3/5 · Day 2 1/4". Optional: older instances omit it. */
|
||||||
|
dayStats?: Record<number, { total: number; targetHit: number }>;
|
||||||
/** One entry per live account (negative ones included, dead ones not):
|
/** One entry per live account (negative ones included, dead ones not):
|
||||||
* its actual progress toward the current target, so the master can
|
* its actual progress toward the current target, so the master can
|
||||||
* simulate the real required profit instead of assuming the winning
|
* simulate the real required profit instead of assuming the winning
|
||||||
|
|||||||
@@ -103,6 +103,15 @@ function collectFirmStats() {
|
|||||||
cfg.targetSameEquity, cfg.withdrawalStages,
|
cfg.targetSameEquity, cfg.withdrawalStages,
|
||||||
client.priorProfit?.[acc.id] ?? 0, fundTxns, cfg.minDayPnL,
|
client.priorProfit?.[acc.id] ?? 0, fundTxns, cfg.minDayPnL,
|
||||||
) : null;
|
) : 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) {
|
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;
|
||||||
@@ -241,6 +250,7 @@ function collectFirmStats() {
|
|||||||
} else if (targetHit) {
|
} else if (targetHit) {
|
||||||
targetHitCount++;
|
targetHitCount++;
|
||||||
slice.targetHit = (slice.targetHit ?? 0) + 1;
|
slice.targetHit = (slice.targetHit ?? 0) + 1;
|
||||||
|
if (dayEntry) dayEntry.targetHit++;
|
||||||
} else {
|
} else {
|
||||||
partialCount++;
|
partialCount++;
|
||||||
slice.partial = (slice.partial ?? 0) + 1;
|
slice.partial = (slice.partial ?? 0) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user