diff --git a/lib/master-protocol.ts b/lib/master-protocol.ts index 97e4ae8..f68895b 100644 --- a/lib/master-protocol.ts +++ b/lib/master-protocol.ts @@ -40,6 +40,10 @@ export interface AccountTypeStats { payoutStates?: { days: number; profit: number; maxDay: number; sum: number; high: number; withdrawals?: number; target?: number; consistency?: number; minDays?: number; + /** Trade date (YYYY-MM-DD) of the account's most recent traded day — + * after the 5 PM CT roll a day booked on tomorrow's trade date is + * already counted in `days`. */ + lastDay?: string; }[]; } diff --git a/lib/reporter.ts b/lib/reporter.ts index 1e34777..938fbeb 100644 --- a/lib/reporter.ts +++ b/lib/reporter.ts @@ -121,6 +121,7 @@ function collectFirmStats() { cfg.targetSameEquity, cfg.withdrawalStages, client.priorProfit?.[acc.id] ?? 0, fundTxns, ); + const traded = combined.dailyPnL.filter((d) => d.pnl !== 0); (slice.payoutStates ??= []).push({ days: qualifying.length, profit: equityProfit, @@ -131,6 +132,7 @@ function collectFirmStats() { target: effective.profitTarget, consistency: effective.consistency, minDays: effective.minTradingDays, + lastDay: traded.length > 0 ? traded.reduce((a, b) => (a.date > b.date ? a : b)).date : undefined, }); }