OPEN-SOURCE SCRIPT
EMA10/20

1️⃣ Trend filter is already TRUE
Price above VWAP
EMA10 > EMA20
EMA20 rising
➡ This stays TRUE for many candles in a strong uptrend.
2️⃣ Pullback condition is TRUE
1–3 red candles already happened
Price is still near EMA20
➡ This condition does not reset immediately.
3️⃣ Engulfing logic is the key problem
Your current engulfing rule is roughly:
Candle is green
Closes above previous close
Above EMA20
Now look at your chart:
First green candle → BUY
Next candle is also green, still above EMA20 → BUY again
Next candle still satisfies all conditions → BUY again
📌 Result:
👉 BUY, BUY, BUY on consecutive candles
That’s why you see 3 BUY labels together.
Price above VWAP
EMA10 > EMA20
EMA20 rising
➡ This stays TRUE for many candles in a strong uptrend.
2️⃣ Pullback condition is TRUE
1–3 red candles already happened
Price is still near EMA20
➡ This condition does not reset immediately.
3️⃣ Engulfing logic is the key problem
Your current engulfing rule is roughly:
Candle is green
Closes above previous close
Above EMA20
Now look at your chart:
First green candle → BUY
Next candle is also green, still above EMA20 → BUY again
Next candle still satisfies all conditions → BUY again
📌 Result:
👉 BUY, BUY, BUY on consecutive candles
That’s why you see 3 BUY labels together.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.