update entry

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

View file

@ -243,12 +243,22 @@ 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") {
entry = analysis.currentBB.upper; 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) { if (side === "sell") {
entry = analysis.currentBB.lower; 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 = {