From c63be0d3e2b80756e0722f24324e62590a31035e Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Mon, 20 Apr 2026 19:40:27 -0500 Subject: [PATCH] Target profitTarget in addition to consistency realTarget computeDailyTarget was only solving for consistency (realTarget = maxDay / consistency). When realTarget < profitTarget, the function would stop trading before hitting the actual profit goal. Now uses Math.max(realTarget, profitTarget) - totalProfit as the remaining needed, capped at maxDay for the daily target. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/trading-logic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/trading-logic.ts b/lib/trading-logic.ts index ec2ce4e..aa3e0f0 100644 --- a/lib/trading-logic.ts +++ b/lib/trading-logic.ts @@ -105,7 +105,8 @@ export function computeDailyTarget( } else { const maxDay = Math.max(...qualifyingDays.map((d) => d.pnl)); const realTarget = maxDay / consistency; - const needed = realTarget - totalProfit; + // Need to satisfy BOTH consistency (realTarget) AND the actual profitTarget + const needed = Math.max(realTarget, profitTarget) - totalProfit; if (needed > maxDay) { baseAmount = maxDay;