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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user