OPEN-SOURCE SCRIPT
Atualizado EMA21 Pullback Buy

EMA21 Pullback Buy is a tool designed to identify constructive pullbacks to the 21-period EMA in strong uptrends.
It highlights candles where:
• The previous close was above EMA21
• The current low touches or dips below EMA21
• The candle closes back above EMA21
These candles are considered potential “support tests” in a trending stock.
You can configure a maximum number of valid tests to avoid late-stage entries.
The script:
• Colors the test candles (optional)
• Marks them with a small circle
• Triggers a buy signal (green triangle) on the first bullish candle that breaks above the test candle’s high
Optional alerts are included for both:
• New EMA21 test
• Buy trigger after valid test
The goal is to help traders find low-risk entries in clean, trending stocks — without chasing breakouts or reacting emotionally. Best used with strong RS names and proper trend context.
It highlights candles where:
• The previous close was above EMA21
• The current low touches or dips below EMA21
• The candle closes back above EMA21
These candles are considered potential “support tests” in a trending stock.
You can configure a maximum number of valid tests to avoid late-stage entries.
The script:
• Colors the test candles (optional)
• Marks them with a small circle
• Triggers a buy signal (green triangle) on the first bullish candle that breaks above the test candle’s high
Optional alerts are included for both:
• New EMA21 test
• Buy trigger after valid test
The goal is to help traders find low-risk entries in clean, trending stocks — without chasing breakouts or reacting emotionally. Best used with strong RS names and proper trend context.
Notas de Lançamento
EMA21 Pullback Buy is a tool designed to identify constructive pullbacks to the 21-period EMA in strong uptrends.It highlights candles where:
• The previous close was above EMA21
• The current low touches or dips below EMA21
• The candle closes back above EMA21
These candles are considered potential “support tests” in a trending stock.
You can configure a maximum number of valid tests to avoid late-stage entries.
The script:
• Colors the test candles (optional)
• Marks them with a small circle
• Triggers a buy signal (green triangle) on the first bullish candle that breaks above the test candle’s high
Optional alerts are included for both:
• New EMA21 test
• Buy trigger after valid test
The goal is to help traders find low-risk entries in clean, trending stocks — without chasing breakouts or reacting emotionally. Best used with strong RS names and proper trend context.
Notas de Lançamento
Version: v1.1Date: 2025-12-11
What’s new:
🔹 Trend Sensitivity Option
You can now choose between three levels of trend strictness:
• Strict – Requires clear uptrend structure with slope and strength
• Moderate – Looser, still prefers alignment between EMAs
• Loose – Only checks that price is above EMA21
This allows you to adapt the indicator to different market conditions (e.g. choppy vs trending).
🔹 Optional EMA10 Momentum Filter
When enabled, the indicator will also require the 10 EMA to be rising, confirming short-term momentum.
This helps avoid noisy signals during weak consolidations or fake reversals.
🧠 These additions improve signal quality and give you better control over the type of pullbacks you want to trade.
No changes were made to entry logic or alerts.
Notas de Lançamento
Version: v1.1Date: 2025-12-11
What’s new:
🔹 Trend Sensitivity Option
You can now choose between three levels of trend strictness:
• Strict – Requires clear uptrend structure with slope and strength
• Moderate – Looser, still prefers alignment between EMAs
• Loose – Only checks that price is above EMA21
This allows you to adapt the indicator to different market conditions (e.g. choppy vs trending).
🔹 Optional EMA10 Momentum Filter
When enabled, the indicator will also require the 10 EMA to be rising, confirming short-term momentum.
This helps avoid noisy signals during weak consolidations or fake reversals.
🧠 These additions improve signal quality and give you better control over the type of pullbacks you want to trade.
No changes were made to entry logic or alerts.
Notas de Lançamento
Version: v1.1Date: 2025-12-11
What’s new:
🔹 Trend Sensitivity Option
You can now choose between three levels of trend strictness:
• Strict – Requires clear uptrend structure with slope and strength
• Moderate – Looser, still prefers alignment between EMAs
• Loose – Only checks that price is above EMA21
This allows you to adapt the indicator to different market conditions (e.g. choppy vs trending).
🔹 Optional EMA10 Momentum Filter
When enabled, the indicator will also require the 10 EMA to be rising, confirming short-term momentum.
This helps avoid noisy signals during weak consolidations or fake reversals.
🧠 These additions improve signal quality and give you better control over the type of pullbacks you want to trade.
No changes were made to entry logic or alerts.
Notas de Lançamento
🆕 Update: Optional Limit for Number of EMA21 TestsVersion: v1.2
Date: 2025-12-11
What’s new:
🔹 Configurable limit for EMA21 tests
Added a new setting:
Limit max number of EMA21 tests – when enabled, the script will only allow a defined number of pullback tests (default: 6) during a trend phase.
If disabled, all valid pullbacks will trigger, even late-stage entries in longer uptrends.
✅ This gives you more control:
• Want to focus only on early pullbacks? Keep it enabled.
• Want to capture all setups in a strong trend? Disable it.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.