fix(simple): rebind armed buys to existing holdings

This commit is contained in:
root 2026-05-06 07:23:03 +00:00
parent 257b10fc81
commit e92236b764

View File

@ -281,6 +281,12 @@ async function main() {
if (!ctx) continue;
if (shouldArmSimpleBuy(entry)) {
const reboundExistingPosition = await bindSimpleBoughtPosition(entry, ctx);
if (reboundExistingPosition) {
logger.info(`[SimpleWorker] Rebound armed buy setup to existing open holding for ${symbol}`);
continue;
}
const currentPrice = resolveSimpleMarketPrice(entry) ?? toPositiveNumber(entry.reference_price);
const triggerPrice = computeSimpleBuyTriggerPrice(entry);
if (!(currentPrice && currentPrice > 0) || !triggerPrice) continue;