OPEN-SOURCE SCRIPT
EMA 50/200 Pullback + RSI/SMA RSI

Strategy Description: EMA 50/200 Pullback + RSI/SMA RSI
1. Trend Identification with EMA:
Uses two Exponential Moving Averages (EMA): a fast EMA (default 50) and a slow EMA (default 200).
When the fast EMA crosses above the slow EMA (bullish crossover), an uptrend is identified.
When the fast EMA crosses below the slow EMA (bearish crossover), a downtrend is identified.
The lengths of both EMAs are fully customizable.
2. EMA Distance Condition:
Signals are only valid when the absolute percentage distance between the two EMAs is within a user-defined range (default: 0.4% to 1%).
This helps filter out weak signals when the EMAs are too close or too far apart.
3. Pullback Condition:
After a new trend is detected (EMA crossover), the strategy waits for the price to pull back to touch or cross the fast EMA (EMA 50).
This ensures entries are not taken immediately at the crossover, but after a retracement to a dynamic support/resistance area.
4. RSI Confirmation:
Uses the RSI indicator (default 14) and its Simple Moving Average (SMA RSI, default 14).
Buy signal: RSI crosses above its SMA.
Sell signal: RSI crosses below its SMA.
Both RSI and SMA RSI lengths are fully customizable.
5. Entry Rules:
The indicator only gives the first buy/sell signal after each EMA crossover (start of a new trend), and will not repeat signals until the next EMA crossover.
Buy signal:
Fast EMA crosses above slow EMA
EMA distance is within the valid range
Price pulls back to the fast EMA
RSI crosses above its SMA
Sell signal:
Fast EMA crosses below slow EMA
EMA distance is within the valid range
Price pulls back to the fast EMA
RSI crosses below its SMA
6. Customization:
All parameters (EMA lengths, RSI length, SMA RSI length, EMA distance range) can be adjusted in the indicator’s settings.
Note:
This is a signal indicator, not a complete trading strategy. For real trading, always combine with risk management and additional confirmations.
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.