Treat Manual Adjustment cash changes as fund transactions

Some firms record withdrawals as "Manual Adjustment" instead of
"Fund Transaction" in the Cash History. Include both types so the
withdrawal-aware cycle filtering still works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-04-20 16:59:22 -05:00
co-authored by Claude Opus 4.6
parent 99e473c687
commit c3ec477c50
+2 -1
View File
@@ -523,7 +523,8 @@ export class TradovateClient {
const fundTimestampMap: { [date: string]: string } = {};
const dailyMap: { [date: string]: number } = {};
for (const row of rows) {
if ((row['Cash Change Type'] ?? '').trim() === 'Fund Transaction') {
const changeType = (row['Cash Change Type'] ?? '').trim();
if (changeType === 'Fund Transaction' || changeType === 'Manual Adjustment') {
const delta = parseFloat((row['Delta'] ?? '0').replace(/,/g, ''));
if (!isNaN(delta)) {
fundMap[row['Date']] = (fundMap[row['Date']] ?? 0) + delta;