OPEN-SOURCE SCRIPT
RSI Divergence Engine | Index | Stocks | Options

RSI Divergence Engine with Dynamic SL/TP
An automated momentum divergence indicator designed to identify high-probability trend reversal setups across 30–40 bar swing windows.
🌟 Key Features
Positive & Negative Divergence: Automatically detects both Bullish (BUY) and Bearish (SELL) price/RSI momentum mismatches.
Filtered Entries: Requires RSI to cross oversold/overbought thresholds (RSI ≤ 45 for BUY, RSI ≥ 55 for SELL) to eliminate mid-range market noise.
Automated SL/TP Lines: Draws clear Entry (Blue), Structural Stop Loss (Red), and Take Profit (Green) lines directly on your chart based on your Risk-to-Reward Ratio (RRR).
200 EMA Overlay: Built-in trend filter line to align divergence trades with the major trend direction.
How to Trade
1. BUY Signal: Look for green labels when price forms a Lower Low while RSI forms a Higher Low in oversold territory.
2. SELL Signal: Look for red labels when price forms a Higher High while RSI forms a Lower High in overbought territory.
3. Execution: Use the dynamically generated Red line for Stop Loss placement and target the Green line for exit.
Recommended Timeframes: 3m, 5m, and 15m intraday charts.
*Disclaimer: For educational and analytical purposes only. Always manage your risk carefully.*
---
Drop your thoughts, backtest results, or questions in the comments below!
An automated momentum divergence indicator designed to identify high-probability trend reversal setups across 30–40 bar swing windows.
🌟 Key Features
Positive & Negative Divergence: Automatically detects both Bullish (BUY) and Bearish (SELL) price/RSI momentum mismatches.
Filtered Entries: Requires RSI to cross oversold/overbought thresholds (RSI ≤ 45 for BUY, RSI ≥ 55 for SELL) to eliminate mid-range market noise.
Automated SL/TP Lines: Draws clear Entry (Blue), Structural Stop Loss (Red), and Take Profit (Green) lines directly on your chart based on your Risk-to-Reward Ratio (RRR).
200 EMA Overlay: Built-in trend filter line to align divergence trades with the major trend direction.
How to Trade
1. BUY Signal: Look for green labels when price forms a Lower Low while RSI forms a Higher Low in oversold territory.
2. SELL Signal: Look for red labels when price forms a Higher High while RSI forms a Lower High in overbought territory.
3. Execution: Use the dynamically generated Red line for Stop Loss placement and target the Green line for exit.
Recommended Timeframes: 3m, 5m, and 15m intraday charts.
*Disclaimer: For educational and analytical purposes only. Always manage your risk carefully.*
---
Drop your thoughts, backtest results, or questions in the comments below!
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.