From 9c2b2278eb177748529c389eed6c7c71f9aa2685 Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Mon, 20 Apr 2026 20:14:52 -0500 Subject: [PATCH] Fall back to base minTradingDays when stage doesn't specify one When a withdrawal stage has minTradingDays unset (0 or missing), use the account's base minTradingDays instead of overriding to 0. This was causing min-day reservation to skip and return consistency-based targets instead of the min-day floor. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/trading-logic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/trading-logic.ts b/lib/trading-logic.ts index c2fec62..c5bcd33 100644 --- a/lib/trading-logic.ts +++ b/lib/trading-logic.ts @@ -33,7 +33,8 @@ export function resolveEffectiveConfig( } const idx = Math.min(withdrawalCount - 1, withdrawalStages.length - 1); const stage = withdrawalStages[idx]; - return { profitTarget: stage.profit, consistency: stage.consistency, minTradingDays: stage.minTradingDays }; + // Fall back to base minTradingDays when the stage doesn't specify one (0 or missing) + return { profitTarget: stage.profit, consistency: stage.consistency, minTradingDays: stage.minTradingDays || minTradingDays }; } return { profitTarget, consistency, minTradingDays }; }