Fix fetchDaysTraded to use reports API with bearer auth and correct daysTraded counting

- Replace fill/ldeps and fill/list approaches with Tradovate reports API
- Add bearer auth to getreport polling (root cause of prior 404s)
- Use endDate = tomorrow to ensure current-session fills are included
- Count all traded days when minDayPnL is 0, otherwise count days >= minDayPnL
- Add PATCH /api/debug endpoint for proxying raw Tradovate API calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Senofy
2026-03-09 18:57:12 -05:00
co-authored by Claude Sonnet 4.6
parent 95e7433941
commit 570a54fe60
10 changed files with 218 additions and 66 deletions
+4
View File
@@ -31,6 +31,10 @@ export interface AccountState {
totalProfit: number;
/** True when today's realizedPnL has met or exceeded the computed daily target */
targetHit: boolean;
/** Next trading day's target, computed server-side. null when account is dead or config is missing. */
dailyTarget: { amount: number; path: 'first_day' | 'normal_day' | 'reduced_day' } | null;
/** FIFO daily P&L history — used by the equity curve and calendar. */
dailyPnL: { date: string; pnl: number }[];
}
export interface FirmState {