Fix daily target dropping below minDayPnL after min days met
Math.max(baseAmount, effectiveMinDay) ensures the floor is always enforced when minDayPnL > 0, not just inside the min-day reservation block. 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
7afc5b9437
commit
58628e0ce1
@@ -146,5 +146,5 @@ export function computeDailyTarget(
|
|||||||
baseAmount = Math.max(0, profitTarget - totalProfit);
|
baseAmount = Math.max(0, profitTarget - totalProfit);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { amount: Math.round(baseAmount * 100) / 100, path };
|
return { amount: Math.round(Math.max(baseAmount, effectiveMinDay) * 100) / 100, path };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user