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:
co-authored by
Claude Opus 4.6
parent
c63be0d3e2
commit
255cf2dd83
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user