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 = {