OPEN-SOURCE SCRIPT
EMA Pullback Indicator [ATR-based]

🟦 EMA Pullback Indicator [ATR-based]
This indicator identifies pullbacks in trending markets using the crossover of two EMAs (Fast and Slow). When a pullback occurs during a valid trend, an entry is triggered after price resumes in the trend direction. ATR is used to dynamically calculate stop-loss and take-profit levels.
🔍 Strategy Logic:
Trend Detection: EMA(8) vs EMA(21)
Pullback Zones:
In a bullish trend, a pullback is when price dips below the Fast EMA
In a bearish trend, a pullback is when price rises above the Fast EMA
Entry Trigger: Re-entry into trend direction after pullback
Stop Loss / Take Profit:
Based on ATR × SL/TP multipliers
Exit Options:
TP/SL Hit
Exit on new pullback (optional toggle)
Multiple Entry Toggle: Choose whether to allow multiple pullback entries or not
⚙️ Inputs:
Fast EMA Length
Slow EMA Length
ATR Period
SL Multiplier
TP Multiplier
Allow Multiple Entries
Exit on New Pullback
📊 Visuals:
Colored EMAs and fill zone between them
Grey bars during pullback
Blue/Black trend bar colors
Entry markers and TP/SL levels with labels
Real-time ATR display in corner
📢 Alerts Included:
Long/Short Pullback Entry
Take Profit Hit
Stop Loss Hit
This indicator identifies pullbacks in trending markets using the crossover of two EMAs (Fast and Slow). When a pullback occurs during a valid trend, an entry is triggered after price resumes in the trend direction. ATR is used to dynamically calculate stop-loss and take-profit levels.
🔍 Strategy Logic:
Trend Detection: EMA(8) vs EMA(21)
Pullback Zones:
In a bullish trend, a pullback is when price dips below the Fast EMA
In a bearish trend, a pullback is when price rises above the Fast EMA
Entry Trigger: Re-entry into trend direction after pullback
Stop Loss / Take Profit:
Based on ATR × SL/TP multipliers
Exit Options:
TP/SL Hit
Exit on new pullback (optional toggle)
Multiple Entry Toggle: Choose whether to allow multiple pullback entries or not
⚙️ Inputs:
Fast EMA Length
Slow EMA Length
ATR Period
SL Multiplier
TP Multiplier
Allow Multiple Entries
Exit on New Pullback
📊 Visuals:
Colored EMAs and fill zone between them
Grey bars during pullback
Blue/Black trend bar colors
Entry markers and TP/SL levels with labels
Real-time ATR display in corner
📢 Alerts Included:
Long/Short Pullback Entry
Take Profit Hit
Stop Loss Hit
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.