OPEN-SOURCE SCRIPT
Diupdate

Adaptive Multi-Timeframe RSI Divergence

881
📈 Adaptive Multi-Timeframe RSI Divergence
Brief Description

A multi-timeframe RSI oscillator that combines weighted higher-timeframe momentum, adaptive trend confirmation, divergence detection, and configurable Flip alerts into a unified momentum analysis framework.

📖 Overview

Adaptive Multi-Timeframe RSI Divergence expands the traditional RSI by introducing a Composite RSI calculated from multiple higher timeframes.

Instead of evaluating momentum from a single timeframe, the indicator compares local RSI behavior with broader market momentum while integrating trend confirmation, divergence detection, and adaptive visualization into one oscillator.

The objective is to reduce noise while providing a more reliable interpretation of momentum shifts.

⭐ Key Features
🔹 Composite Multi-Timeframe RSI

• Combines RSI values from three configurable higher timeframes.

• Uses customizable weighting for each timeframe.

• Smooths the result with an EMA to reduce noise.

🔹 Adaptive Trend Detection

Trend changes require multiple confirmation conditions:

✅ RSI crossover

✅ Minimum RSI distance

✅ RSI slope confirmation

✅ Confirmation bars

✅ Deadband filtering

This helps avoid false flips during ranging markets.

🔹 Flip Detection Engine

The Flip Engine confirms bullish and bearish momentum transitions only after all validation rules have been satisfied.

Flip labels and alerts are generated after confirmation rather than immediately at crossover.

🔹 RSI Divergence Detection

Supports:

• Regular Bullish

• Hidden Bullish

• Regular Bearish

• Hidden Bearish

using configurable pivot detection and lookback filtering.

🔹 Dynamic RSI Zones

Highlights active overbought and oversold regions only when RSI enters those zones, improving readability without permanently coloring the oscillator.

🔹 Trend Ribbon

🟢 Green = Confirmed Bullish Momentum

🔴 Red = Confirmed Bearish Momentum

🟣 Purple = Momentum Transition

🔔 Alerts

Includes alert conditions for:

• Bullish Flip

• Bearish Flip

Alerts trigger only after confirmation.

⚙️ Inputs

The script allows customization of:

• RSI Settings

• Composite RSI Timeframes

• Timeframe Weights

• Flip Detection

• Confirmation Rules

• Divergence Settings

📊 How to Interpret

🟢 Bullish Flip

Momentum has shifted toward bullish conditions after confirmation.

🔴 Bearish Flip

Momentum has shifted toward bearish conditions after confirmation.

📈 Composite RSI

Represents weighted higher-timeframe momentum.

📍 Divergences

Highlight potential exhaustion or continuation depending on the divergence type.

🎯 Best Applications

• Swing Trading

• Trend Confirmation

• Momentum Analysis

• Multi-Timeframe Analysis

• Divergence Confirmation

⚠️ Limitations

Like all momentum indicators, this script should be used as a decision-support tool rather than a standalone trading system.

Divergences and momentum shifts may persist before price reacts. Additional confirmation from price action or risk management techniques is recommended.

💡 Originality

Unlike a traditional RSI indicator, this script introduces several original concepts:

✔ Weighted Composite RSI using multiple higher timeframes.

✔ Adaptive trend confirmation using RSI distance, slope, persistence filters, and deadband logic.

✔ Configurable Flip Detection Engine.

✔ Trend-state ribbon.

✔ Integrated divergence detection.

✔ Built-in alert system.

Rather than simply combining existing indicators, the objective is to create a unified momentum framework that filters market noise while providing a broader view of momentum across multiple time horizons.
Catatan Rilis
🆕 New Features
🔹 Major High / Low Season Banners

A new banner system has been introduced to help identify significant RSI turning points.

Instead of marking every pivot, the indicator now focuses on major peaks and valleys, making important RSI structure much easier to recognize.

Highlights:

🔵 High (H) banners identify major RSI peaks.
🟠 Low (L) banners identify major RSI valleys.
📍 Dynamic positioning keeps banners above or below the oscillator to improve readability and reduce overlap.
🎯 Built-in swing filtering helps ignore many insignificant RSI fluctuations.
📏 Adjustable spacing between banners helps reduce chart clutter.
🔔 New Alert Conditions

Added dedicated alerts for the new banner system.

You can now create TradingView alerts for:

✅ RSI High Banner

✅ RSI Low Banner

These alerts trigger whenever a new qualified High or Low banner is confirmed.

⚙️ New User Inputs

Added several customization options for the new banner system:

🎛️ Enable/Disable High-Low Banners
📐 Minimum RSI Swing Size
📏 Minimum Bars Between Banners
↕️ Banner Vertical Offset

These settings allow users to adjust the sensitivity of the banner detection according to different markets and trading styles.

🎨 Visual Improvements

The banner placement has been redesigned to improve chart clarity.

Instead of drawing labels directly over the RSI line, banners are automatically positioned with a dynamic offset, helping maintain visibility during periods of high volatility or overlapping signals.

🛠 Internal Improvements
Improved organization of the banner detection logic.
Added reusable banner event variables to simplify future development.
Integrated banner events with TradingView's native alert system.
Improved code readability and maintainability for future updates.
❤️ Thank You!

Thank you for all the feedback and ideas that continue to improve this project.

Your suggestions help make this indicator more practical, cleaner, and easier to use for the entire community.

May God bless all your investments and trades! 🙏📈

Proverbs 13:22
"The wealth of the sinner is stored up for the righteous."
Catatan Rilis
🚀 Release Notes — Adaptive Multi-Timeframe RSI Divergence

🌦️ New RSI Seasons
A season begins when the trend tint changes and ends at the next tint change.

🟢 Green season: displays the dominant HH and latest HL.
🔴 Red season: displays the dominant LL and latest LH.

Superseded labels are automatically removed to reduce clutter.
Labels remain tiny and sit directly on their RSI pivots.

🎨 Strength Background

The background now communicates momentum strength:

💚 Bright green: bullish momentum is advancing toward a new seasonal high.
🟢 Light green: bullish momentum has stopped making new highs.
❤️ Strong red: bearish momentum is advancing toward a new seasonal low.
🔴 Light red: bearish momentum has stopped making new lows.
🟣 Purple: the indicator is transitioning between trend tints.

When RSI exceeds the latest seasonal HH or LL, the strong-color zone expands immediately. The eventual pivot label acts as confirmation—not as the trigger.

🧹 Cleaner Presentation
Reduced excessive market-structure banners.
Increased label and background-box capacity.
Added alerts for seasonal HH, HL, LH, LL, and tint flips.
Existing multi-timeframe composite RSI and divergence features remain available.

⚠️ Friendly Disclosure

The active season’s strength background is intentionally dynamic:
It can expand intrabar when RSI exceeds the latest seasonal extreme.
It may retract if the live candle moves back before closing.
Confirmed HH/HL/LH/LL labels require pivot confirmation and are then placed on the original pivot bar.

Completed seasons remain frozen.

No future-data lookahead is used.

Momentum structure is informational and does not guarantee a corresponding price-trend reversal. Always use appropriate confirmation and risk management. 🛡️📊

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.