OPEN-SOURCE SCRIPT
Zero-Lag RSI Divergence

Zero-Lag RSI Divergence
Overview
This indicator identifies RSI divergences in real-time without delay, providing immediate signals as price-momentum discrepancies develop. The indicator analyzes price action against RSI momentum across dual configurable periods, enabling traders to detect potential reversal opportunities with zero lag.
Key Features
Instant Divergence Detection: Identifies bullish and bearish divergences immediately upon formation without waiting for candle confirmation or historical validation. This eliminates signal delay but may increase false signals due to higher sensitivity.
Dual Period Analysis: Configure detection across two independent cycles - Short Period (default 15) and Long Period (default 50) - allowing for multi-timeframe divergence analysis and enhanced signal validation across different market conditions.
Visual Divergence Lines: Automatically draws dashed lines connecting divergence points between price highs/lows and corresponding RSI peaks/troughs, clearly illustrating the momentum-price relationship.
Customizable RSI Parameters: Adjustable RSI length (default 14) allows optimization for different market volatility and trading timeframes.
How It Works
The indicator continuously monitors price action patterns and RSI momentum:
- Bullish Divergence: Detected when price makes lower lows while RSI makes higher lows, suggesting potential upward momentum
- Bearish Divergence: Identified when price makes higher highs while RSI makes lower highs, indicating potential downward momentum
The algorithm uses candle color transitions and immediate RSI comparisons to trigger signals without historical repainting, ensuring backtesting accuracy and real-time reliability.
How To Read

Important Notes
Higher Signal Frequency: The zero-lag approach increases signal sensitivity, generating more frequent alerts that may include false signals. Consider using additional confirmation methods for trade entries.
Non-Repainting: All signals are generated and maintained without historical modification, ensuring consistent backtesting and forward-testing results.
Input Parameters
This indicator is designed for traders seeking immediate divergence identification across multiple timeframes while maintaining signal integrity and backtesting reliability.
Overview
This indicator identifies RSI divergences in real-time without delay, providing immediate signals as price-momentum discrepancies develop. The indicator analyzes price action against RSI momentum across dual configurable periods, enabling traders to detect potential reversal opportunities with zero lag.
Key Features
Instant Divergence Detection: Identifies bullish and bearish divergences immediately upon formation without waiting for candle confirmation or historical validation. This eliminates signal delay but may increase false signals due to higher sensitivity.
Dual Period Analysis: Configure detection across two independent cycles - Short Period (default 15) and Long Period (default 50) - allowing for multi-timeframe divergence analysis and enhanced signal validation across different market conditions.
Visual Divergence Lines: Automatically draws dashed lines connecting divergence points between price highs/lows and corresponding RSI peaks/troughs, clearly illustrating the momentum-price relationship.
Customizable RSI Parameters: Adjustable RSI length (default 14) allows optimization for different market volatility and trading timeframes.
How It Works
The indicator continuously monitors price action patterns and RSI momentum:
- Bullish Divergence: Detected when price makes lower lows while RSI makes higher lows, suggesting potential upward momentum
- Bearish Divergence: Identified when price makes higher highs while RSI makes lower highs, indicating potential downward momentum
The algorithm uses candle color transitions and immediate RSI comparisons to trigger signals without historical repainting, ensuring backtesting accuracy and real-time reliability.
How To Read
Important Notes
Higher Signal Frequency: The zero-lag approach increases signal sensitivity, generating more frequent alerts that may include false signals. Consider using additional confirmation methods for trade entries.
Non-Repainting: All signals are generated and maintained without historical modification, ensuring consistent backtesting and forward-testing results.
Input Parameters
- RSI Length: Period for RSI calculation (default: 14)
- Short/Long Periods: Lookback periods for divergence detection (default: 15/50)
- Line Colors: Customizable colors for short and long period divergence lines
- Label Settings: Optional divergence labels with custom text
This indicator is designed for traders seeking immediate divergence identification across multiple timeframes while maintaining signal integrity and backtesting reliability.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Day trader with RSI.
RSI 101 at rsi-101.gitbook.io/book
Telegram: t.me/daorsichat
RSI 101 at rsi-101.gitbook.io/book
Telegram: t.me/daorsichat
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Day trader with RSI.
RSI 101 at rsi-101.gitbook.io/book
Telegram: t.me/daorsichat
RSI 101 at rsi-101.gitbook.io/book
Telegram: t.me/daorsichat
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.