diff --git a/lib/trading-logic.ts b/lib/trading-logic.ts index 99e06af..08b070c 100644 --- a/lib/trading-logic.ts +++ b/lib/trading-logic.ts @@ -79,11 +79,8 @@ export function computeDailyTarget( // Floor: must make at least minDayPnL today (or whatever is left if less) const floor = Math.min(effectiveMinDay, remaining); - // When consistency = 0% (baseAmount = 0), there's no consistency-based upper bound — - // target cappedByFuture directly (make as much as possible today, reserve future days). - // When consistency > 0%, treat baseAmount as the consistency cap. - const consistencyCapped = baseAmount > 0 ? Math.min(baseAmount, cappedByFuture) : cappedByFuture; - const amount = Math.max(floor, consistencyCapped); + // 0% consistency → no upper bound, take cappedByFuture; otherwise cap at baseAmount + const amount = Math.max(floor, baseAmount > 0 ? Math.min(baseAmount, cappedByFuture) : cappedByFuture); return { amount: Math.round(amount * 100) / 100, path }; }