diff --git a/backend/src/index.ts b/backend/src/index.ts index 3939f1d..c143686 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -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;