This commit is contained in:
KienVT9 2025-07-17 14:54:17 +07:00
parent a162c5fae6
commit 2bcda92196

View file

@ -36,7 +36,7 @@ export class IndicatorService {
}
let close = candles.map((c) => c.close);
const ema34 = EMA.calculate({
period: 34,
period: 20,
values: close,
reversedInput: true,
});
@ -244,19 +244,19 @@ export class IndicatorService {
);
let entry = candles[0].close;
if (side === "buy") {
if (analysis.currentBB.upper < candles[0].close && analysis.currentBB.upper > candles[0].open) {
if (analysis.currentBB.upper < Math.max(candles[0].close, candles[0].open)) {
entry = analysis.currentBB.upper;
}
if (analysis.currentBB.lower < candles[0].close && analysis.currentBB.lower > candles[0].open) {
if (analysis.currentBB.lower < candles[0].open && 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) {
if (analysis.currentBB.lower > Math.min(candles[0].close, candles[0].open)) {
entry = analysis.currentBB.lower;
}
if (analysis.currentBB.upper > candles[0].close && analysis.currentBB.upper < candles[0].open) {
if (analysis.currentBB.upper > candles[0].open && analysis.currentBB.upper < candles[0].close) {
entry = analysis.currentBB.upper;
}
}