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:
co-authored by
Claude Fable 5
parent
79ee5773cb
commit
620ab54d42
@@ -40,6 +40,10 @@ export interface AccountTypeStats {
|
|||||||
payoutStates?: {
|
payoutStates?: {
|
||||||
days: number; profit: number; maxDay: number; sum: number; high: number;
|
days: number; profit: number; maxDay: number; sum: number; high: number;
|
||||||
withdrawals?: number; target?: number; consistency?: number; minDays?: 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;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ function collectFirmStats() {
|
|||||||
cfg.targetSameEquity, cfg.withdrawalStages,
|
cfg.targetSameEquity, cfg.withdrawalStages,
|
||||||
client.priorProfit?.[acc.id] ?? 0, fundTxns,
|
client.priorProfit?.[acc.id] ?? 0, fundTxns,
|
||||||
);
|
);
|
||||||
|
const traded = combined.dailyPnL.filter((d) => d.pnl !== 0);
|
||||||
(slice.payoutStates ??= []).push({
|
(slice.payoutStates ??= []).push({
|
||||||
days: qualifying.length,
|
days: qualifying.length,
|
||||||
profit: equityProfit,
|
profit: equityProfit,
|
||||||
@@ -131,6 +132,7 @@ function collectFirmStats() {
|
|||||||
target: effective.profitTarget,
|
target: effective.profitTarget,
|
||||||
consistency: effective.consistency,
|
consistency: effective.consistency,
|
||||||
minDays: effective.minTradingDays,
|
minDays: effective.minTradingDays,
|
||||||
|
lastDay: traded.length > 0 ? traded.reduce((a, b) => (a.date > b.date ? a : b)).date : undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user