OPEN-SOURCE SCRIPT
EMA Trend Buy Sell Setup

Code Summary
This script is a technical analysis indicator that combines Exponential Moving Averages (EMAs) and Relative Strength Index (RSI) to identify market trends, potential bottoms, and tops. Essentially a trend-following and reversal-detection tool, blending EMAs for structure and RSI for momentum.
EMAs plotted: 9, 13, 20, 50, 111, 200, and 350 (scaled×2 - pi index).
Trend detection: Background color changes depending on whether price is cheap or expensive based on the 200 EMA (long-term trend filter).
EMA Crossovers:
Bullish cross: EMA9 crossing above EMA20.
Golden cross: EMA50 crossing above EMA200 (strong uptrend).
Bearish cross: EMA9 crossing below EMA20.
Death cross: EMA50 crossing below EMA200 (strong downtrend).
Visual alerts: Labels appear on the chart when these crosses occur, and background highlights show RSI overbought/oversold conditions filtered by trend.
Object of the Script:
The main objective is to combine moving average trend analysis with RSI momentum signals to help traders identify: Long-term trend direction; Short-term entry/exit points; Potential reversal zones (tops and bottoms)
Ideas for Use
Trend confirmation: Use large timeframes with EMA200 and EMA350 as long-term filters to avoid trading against the dominant trend.
Momentum entries: Enter trades when RSI aligns with EMA crossovers (e.g., bullish cross + RSI oversold in uptrend).
Risk management: Avoid entries when RSI is overbought in a downtrend or oversold in an uptrend.
Multi-timeframe confluence: Check RSI signals across different timeframes to confirm strength of a move and to identify buying opportunities.
Indicatives of Trend, Bottom, and Top
Trend:
Price above long term EMA → Uptrend
Price below long term EMA → Downtrend
Bottom signals: green lighting in longer time frames
Top signals: red lighting in longer time frames
RSI > 70 (overbought) while price is below EMA200 → Possible bearish reversal zone.
Bearish cross (EMA9 < EMA20) or death cross (EMA50 < EMA200) after overbought RSI → Stronger top confirmation.
This script is a technical analysis indicator that combines Exponential Moving Averages (EMAs) and Relative Strength Index (RSI) to identify market trends, potential bottoms, and tops. Essentially a trend-following and reversal-detection tool, blending EMAs for structure and RSI for momentum.
EMAs plotted: 9, 13, 20, 50, 111, 200, and 350 (scaled×2 - pi index).
Trend detection: Background color changes depending on whether price is cheap or expensive based on the 200 EMA (long-term trend filter).
EMA Crossovers:
Bullish cross: EMA9 crossing above EMA20.
Golden cross: EMA50 crossing above EMA200 (strong uptrend).
Bearish cross: EMA9 crossing below EMA20.
Death cross: EMA50 crossing below EMA200 (strong downtrend).
Visual alerts: Labels appear on the chart when these crosses occur, and background highlights show RSI overbought/oversold conditions filtered by trend.
Object of the Script:
The main objective is to combine moving average trend analysis with RSI momentum signals to help traders identify: Long-term trend direction; Short-term entry/exit points; Potential reversal zones (tops and bottoms)
Ideas for Use
Trend confirmation: Use large timeframes with EMA200 and EMA350 as long-term filters to avoid trading against the dominant trend.
Momentum entries: Enter trades when RSI aligns with EMA crossovers (e.g., bullish cross + RSI oversold in uptrend).
Risk management: Avoid entries when RSI is overbought in a downtrend or oversold in an uptrend.
Multi-timeframe confluence: Check RSI signals across different timeframes to confirm strength of a move and to identify buying opportunities.
Indicatives of Trend, Bottom, and Top
Trend:
Price above long term EMA → Uptrend
Price below long term EMA → Downtrend
Bottom signals: green lighting in longer time frames
Top signals: red lighting in longer time frames
RSI > 70 (overbought) while price is below EMA200 → Possible bearish reversal zone.
Bearish cross (EMA9 < EMA20) or death cross (EMA50 < EMA200) after overbought RSI → Stronger top confirmation.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.