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) <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-04-20 19:40:27 -05:00
co-authored by Claude Opus 4.6
parent c3ec477c50
commit c63be0d3e2
+2 -1
View File
@@ -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;