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.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。