From 58628e0ce1fc3ea3173e6c1f87a22c026c39c5db Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Thu, 2 Apr 2026 17:18:39 -0500 Subject: [PATCH] Fix daily target dropping below minDayPnL after min days met Math.max(baseAmount, effectiveMinDay) ensures the floor is always enforced when minDayPnL > 0, not just inside the min-day reservation block. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/trading-logic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trading-logic.ts b/lib/trading-logic.ts index 7a3afd7..ec2ce4e 100644 --- a/lib/trading-logic.ts +++ b/lib/trading-logic.ts @@ -146,5 +146,5 @@ export function computeDailyTarget( baseAmount = Math.max(0, profitTarget - totalProfit); } - return { amount: Math.round(baseAmount * 100) / 100, path }; + return { amount: Math.round(Math.max(baseAmount, effectiveMinDay) * 100) / 100, path }; }