Report each account's last traded trade date

Sessions roll at 5 PM CT, so after tonight's open a day booked on
tomorrow's trade date is already in the day count — lastDay is what lets
the master tell those accounts apart from ones that have not traded the
current session yet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-10 18:51:59 -05:00
co-authored by Claude Fable 5
parent 79ee5773cb
commit 620ab54d42
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -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;
}[];
}
+2
View File
@@ -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,
});
}