update entry

This commit is contained in:
KienVT9 2025-07-16 23:21:08 +07:00
parent c01cae412f
commit a162c5fae6

View file

@ -243,13 +243,23 @@ export class IndicatorService {
Number.MIN_SAFE_INTEGER Number.MIN_SAFE_INTEGER
); );
let entry = candles[0].close; let entry = candles[0].close;
if (side === "buy" && analysis.currentBB.upper < candles[0].close) { if (side === "buy") {
if (analysis.currentBB.upper < candles[0].close && analysis.currentBB.upper > candles[0].open) {
entry = analysis.currentBB.upper; entry = analysis.currentBB.upper;
} }
if (analysis.currentBB.lower < candles[0].close && analysis.currentBB.lower > candles[0].open) {
if (side === "sell" && analysis.currentBB.lower > candles[0].close) {
entry = analysis.currentBB.lower; 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 = { const order: Order = {
symbol: analysis.symbol, symbol: analysis.symbol,