fix(simple): rebind armed buys to existing holdings
This commit is contained in:
parent
257b10fc81
commit
e92236b764
@ -281,6 +281,12 @@ async function main() {
|
|||||||
if (!ctx) continue;
|
if (!ctx) continue;
|
||||||
|
|
||||||
if (shouldArmSimpleBuy(entry)) {
|
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 currentPrice = resolveSimpleMarketPrice(entry) ?? toPositiveNumber(entry.reference_price);
|
||||||
const triggerPrice = computeSimpleBuyTriggerPrice(entry);
|
const triggerPrice = computeSimpleBuyTriggerPrice(entry);
|
||||||
if (!(currentPrice && currentPrice > 0) || !triggerPrice) continue;
|
if (!(currentPrice && currentPrice > 0) || !triggerPrice) continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user