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.
|
// The min-day reservation block below handles any mandatory-day targeting.
|
||||||
baseAmount = 0;
|
baseAmount = 0;
|
||||||
path = 'reduced_day';
|
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 {
|
} else {
|
||||||
const maxDay = Math.max(...qualifyingDays.map((d) => d.pnl));
|
const maxDay = Math.max(...qualifyingDays.map((d) => d.pnl));
|
||||||
const realTarget = maxDay / consistency;
|
const realTarget = maxDay / consistency;
|
||||||
// Need to satisfy BOTH consistency (realTarget) AND the actual profitTarget
|
const needed = realTarget - totalProfit;
|
||||||
const needed = Math.max(realTarget, profitTarget) - totalProfit;
|
|
||||||
|
|
||||||
if (needed > maxDay) {
|
if (needed > maxDay) {
|
||||||
baseAmount = maxDay;
|
baseAmount = maxDay;
|
||||||
|
|||||||
Reference in New Issue
Block a user