Stop consistency calc once profitTarget is met

When totalProfit >= profitTarget, set baseAmount = 0 so the min-day
reservation block takes over. This returns effectiveMinDay ($150) for
remaining mandatory days instead of climbing toward maxDay/consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-04-20 19:49:44 -05:00
co-authored by Claude Opus 4.6
parent c63be0d3e2
commit 255cf2dd83
+5 -2
View File
@@ -102,11 +102,14 @@ export function computeDailyTarget(
// The min-day reservation block below handles any mandatory-day targeting.
baseAmount = 0;
path = 'reduced_day';
} else if (totalProfit >= profitTarget) {
// Profit target already met — stop solving for consistency, let min-day reservation handle remaining days
baseAmount = 0;
path = 'reduced_day';
} else {
const maxDay = Math.max(...qualifyingDays.map((d) => d.pnl));
const realTarget = maxDay / consistency;
// Need to satisfy BOTH consistency (realTarget) AND the actual profitTarget
const needed = Math.max(realTarget, profitTarget) - totalProfit;
const needed = realTarget - totalProfit;
if (needed > maxDay) {
baseAmount = maxDay;