From 24a54c66424df9677ef65720b09684e79fa806e9 Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Fri, 21 Aug 2026 18:34:25 -0500 Subject: [PATCH] Treat Challenge Payout cash changes as fund transactions Some firms record payouts as "Challenge Payout" in the Cash History rather than "Fund Transaction" or "Manual Adjustment". Without this the payout was summed into that day's P&L (a -2,000 payout turned a +1,416 day into -584) and never reset the cycle, so daysTraded kept counting and the stage never advanced. Verified against a captured report: the payout is now recorded as a fund transaction, excluded from daily P&L, and because its timestamp precedes the day's first trade the day's trades land in the new cycle. Co-Authored-By: Claude --- lib/tradovate-class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tradovate-class.ts b/lib/tradovate-class.ts index a5e17e7..0694f7c 100644 --- a/lib/tradovate-class.ts +++ b/lib/tradovate-class.ts @@ -557,7 +557,7 @@ export class TradovateClient { const firstTradeTsMap: { [date: string]: string } = {}; for (const row of rows) { const changeType = (row['Cash Change Type'] ?? '').trim(); - if (changeType === 'Fund Transaction' || changeType === 'Manual Adjustment') { + if (changeType === 'Fund Transaction' || changeType === 'Manual Adjustment' || changeType === 'Challenge Payout') { const delta = parseFloat((row['Delta'] ?? '0').replace(/,/g, '')); if (!isNaN(delta)) { fundMap[row['Date']] = (fundMap[row['Date']] ?? 0) + delta;