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:
co-authored by
Claude Opus 4.6
parent
99e473c687
commit
c3ec477c50
@@ -523,7 +523,8 @@ export class TradovateClient {
|
|||||||
const fundTimestampMap: { [date: string]: string } = {};
|
const fundTimestampMap: { [date: string]: string } = {};
|
||||||
const dailyMap: { [date: string]: number } = {};
|
const dailyMap: { [date: string]: number } = {};
|
||||||
for (const row of rows) {
|
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, ''));
|
const delta = parseFloat((row['Delta'] ?? '0').replace(/,/g, ''));
|
||||||
if (!isNaN(delta)) {
|
if (!isNaN(delta)) {
|
||||||
fundMap[row['Date']] = (fundMap[row['Date']] ?? 0) + delta;
|
fundMap[row['Date']] = (fundMap[row['Date']] ?? 0) + delta;
|
||||||
|
|||||||
Reference in New Issue
Block a user