From a162c5fae6e5268b2d49171c319c6a458cf5ca18 Mon Sep 17 00:00:00 2001 From: KienVT9 Date: Wed, 16 Jul 2025 23:21:08 +0700 Subject: [PATCH] update entry --- src/services/indicatorService.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/services/indicatorService.ts b/src/services/indicatorService.ts index a769a05..1eb8bdc 100644 --- a/src/services/indicatorService.ts +++ b/src/services/indicatorService.ts @@ -243,12 +243,22 @@ export class IndicatorService { Number.MIN_SAFE_INTEGER ); let entry = candles[0].close; - if (side === "buy" && analysis.currentBB.upper < candles[0].close) { - entry = analysis.currentBB.upper; + if (side === "buy") { + if (analysis.currentBB.upper < candles[0].close && analysis.currentBB.upper > candles[0].open) { + entry = analysis.currentBB.upper; + } + if (analysis.currentBB.lower < candles[0].close && analysis.currentBB.lower > candles[0].open) { + entry = analysis.currentBB.lower; + } } - if (side === "sell" && analysis.currentBB.lower > candles[0].close) { - entry = analysis.currentBB.lower; + if (side === "sell") { + if (analysis.currentBB.lower > candles[0].close && analysis.currentBB.lower < candles[0].open) { + entry = analysis.currentBB.lower; + } + if (analysis.currentBB.upper > candles[0].close && analysis.currentBB.upper < candles[0].open) { + entry = analysis.currentBB.upper; + } } const order: Order = {