RSI DNARSI dna Oscillator is a momentum analysis tool built around RSI, divergence detection, multi-timeframe RSI readings, volume context, failure swings, higher timeframe bias, and RSI compression behavior.
The purpose of this indicator is to help traders read momentum conditions in a structured way. It is designed to show when RSI is bullish, bearish, overbought, oversold, compressed around the midline, or showing divergence against price action.
This script is an indicator only. It does not place trades, does not provide financial advice, and does not guarantee future results. It should be used together with price action, market structure, support and resistance, volume, and personal risk management.
────────────────────────────
MAIN FEATURES
────────────────────────────
RSI Engine
The core of the indicator is a standard RSI calculation. The RSI line, histogram, midline, overbought zone, and oversold zone help identify bullish or bearish momentum conditions.
Divergence Detection
The indicator can detect regular and hidden bullish or bearish divergences between price and RSI. Divergence lines and labels can be displayed directly inside the oscillator panel.
Volume-Confirmed Divergences
An optional volume filter can be used to validate divergences only when volume conditions are present. The filter can use volume spike, absorption wick behavior, volume fade, or a combination of these conditions.
Heiken Ashi RSI Mode
The script includes an optional Heiken Ashi smoothing mode calculated from RSI values. This can help reduce visual noise in the oscillator. Opposite RSI candles can also be masked when they conflict with the smoothed HA direction.
Failure Swing Engine
The indicator includes an optional RSI failure swing module. This is separated from classical divergence detection. It looks for RSI reversal structures based on RSI pivots, break levels, and confirmation.
MTF RSI Matrix
The dashboard can display RSI values from multiple timeframes. This helps compare short-term and higher-timeframe momentum from the same panel.
HTF Bias Filter
Signals can optionally be filtered by a higher timeframe bias using EMA, RSI, or EMA plus RSI. This can help avoid signals that go against the selected higher timeframe condition.
RSI Squeeze Mode
The indicator can detect when RSI compresses around the midline. A squeeze condition suggests that momentum is tight or undecided. Release signals can appear when RSI expands away from the compression area.
Volume Profile Display
A small volume profile-style column display is included in the oscillator panel. It shows relative volume strength compared to its moving average.
Candle Color Mode
The script can optionally color chart candles using different logic modes, including RSI midline, higher timeframe bias, or high/low structure. The high/low structure mode is designed to provide a simple bullish or bearish reading based on price making higher highs and higher lows, or lower highs and lower lows.
Alerts
The script includes alerts for RSI midline crosses, overbought and oversold entries/exits, divergences, Heiken Ashi RSI flips, volume spikes, failure swings, RSI squeeze, and squeeze releases.
────────────────────────────
INPUTS EXPLAINED
────────────────────────────
RSI ENGINE
RSI Length
Controls the RSI calculation period. A lower value makes RSI more reactive. A higher value makes RSI smoother.
Overbought
Defines the upper RSI level used to mark overbought conditions. The default value is commonly set around 70.
Oversold
Defines the lower RSI level used to mark oversold conditions. The default value is commonly set around 30.
Midline
Defines the center level used to separate bullish and bearish RSI zones. The default value is 50.
────────────────────────────
HEIKEN ASHI MODE
Enable HA Smoothing
Turns RSI Heiken Ashi smoothing on or off.
HA Smooth Length
Controls the smoothing length used in the RSI Heiken Ashi calculation.
Mask Opposite Candles
When enabled, the indicator softens or hides RSI candles that move against the current HA RSI direction. This can make the oscillator easier to read in trend conditions.
────────────────────────────
DIVERGENCE
Divergence Lookback
Controls the pivot length used to detect price and RSI pivot points. A smaller value detects more divergences. A larger value is stricter and produces fewer signals.
Show Regular Div
Shows or hides regular bullish and bearish divergences.
Show Hidden Div
Shows or hides hidden bullish and bearish divergences.
Show Divergence Lines
Shows or hides the lines connecting RSI pivot points during divergence signals.
Require Volume-Confirmed Divergence
When enabled, divergences must also match the selected volume confirmation condition.
Volume Confirmation Mode
Selects the type of volume behavior required:
* Spike
* Absorption
* Volume Fade
* Spike or Absorption
* Any
Divergence Volume Spike x MA
Defines how much volume must exceed its moving average to be considered a spike.
Absorption Wick Ratio
Defines the wick size required for absorption-style confirmation.
────────────────────────────
VOLUME PROFILE
Show Volume Profile
Shows or hides the relative volume columns in the oscillator panel.
Volume Profile Length
Controls the volume moving average length used to calculate relative volume.
Profile Bar Width
Controls the visual width of the volume profile columns.
────────────────────────────
DNA VISUAL
Show DNA Strands
Shows or hides the wave-style visual strands in the oscillator panel. This is disabled by default for a cleaner layout.
DNA Wave Frequency
Controls how fast the visual strands oscillate.
DNA Amplitude
Controls how far the visual strands move around the midline.
────────────────────────────
FAILURE SWING ENGINE
Enable Failure Swing Engine
Turns RSI failure swing detection on or off.
Show Failure Swing Break Lines
Shows or hides the break level line used by the failure swing engine.
RSI Failure Swing Pivot
Controls the pivot sensitivity used for failure swing detection.
Require OB/OS Origin
When enabled, bullish failure swings must begin from oversold conditions and bearish failure swings must begin from overbought conditions.
Failure Swing Label Size
Controls the size of failure swing labels.
────────────────────────────
MTF RSI MATRIX
Show MTF RSI Matrix In Dashboard
Shows or hides the multi-timeframe RSI values in the dashboard.
Matrix TF 1
First RSI timeframe displayed in the matrix.
Matrix TF 2
Second RSI timeframe displayed in the matrix.
Matrix TF 3
Third RSI timeframe displayed in the matrix.
Matrix TF 4
Fourth RSI timeframe displayed in the matrix.
Matrix TF 5
Fifth RSI timeframe displayed in the matrix.
These timeframes can be adjusted to match scalping, intraday, swing, or higher-timeframe analysis.
────────────────────────────
HTF BIAS FILTER
Enable HTF Bias Filter
Turns higher timeframe filtering on or off.
HTF Bias Timeframe
Selects the higher timeframe used for bias filtering.
HTF Bias Mode
Selects the filter method:
* EMA
* RSI
* EMA + RSI
HTF EMA Length
Controls the EMA length used for higher timeframe trend bias.
HTF RSI Bull Level
Defines the RSI level required for bullish higher timeframe confirmation.
HTF RSI Bear Level
Defines the RSI level required for bearish higher timeframe confirmation.
────────────────────────────
RSI SQUEEZE MODE
Enable RSI Squeeze Mode
Turns RSI compression detection on or off.
Squeeze Length
Controls the lookback length used to measure RSI compression.
Compression Distance Around Mid
Defines how close RSI must stay around the midline to be considered compressed.
Max RSI StdDev In Squeeze
Defines the maximum RSI standard deviation allowed during compression.
Release Distance From Mid
Defines how far RSI must move away from the midline to mark a release.
Post-Squeeze Release Window
Defines how many bars after compression can still qualify as a squeeze release.
────────────────────────────
CANDLE COLOR MODE
Candle Color Mode
Allows chart candles to be colored using the selected logic.
RSI Midline Mode
Colors candles based on whether RSI is above or below the midline.
HTF Bias Mode
Colors candles based on the selected higher timeframe bias.
High/Low Structure Mode
Colors candles using simple structure logic:
* Bullish when price makes a higher high and higher low
* Bearish when price makes a lower high and lower low
This mode is designed to be easy to read for beginners.
────────────────────────────
MINI TUTORIAL
────────────────────────────
1. Add the indicator to the chart.
2. Start with default settings.
3. Look at the RSI line:
* Above the midline means bullish RSI pressure.
* Below the midline means bearish RSI pressure.
* Above the overbought level means RSI is in an upper extreme zone.
* Below the oversold level means RSI is in a lower extreme zone.
4. Check the dashboard:
The dashboard shows the current RSI value, trend state, zone state, divergence status, volume behavior, higher timeframe bias, and multi-timeframe RSI values.
5. Watch for divergences:
A bullish divergence can appear when price makes a lower low while RSI makes a higher low.
A bearish divergence can appear when price makes a higher high while RSI makes a lower high.
6. Use volume confirmation carefully:
If volume-confirmed divergence is enabled, the divergence must also match the selected volume condition. This can reduce the number of signals.
7. Use the MTF RSI Matrix:
If most timeframes show RSI above the midline, momentum is generally stronger on the bullish side.
If most timeframes show RSI below the midline, momentum is generally weaker or bearish.
Mixed readings usually mean the market is less clear.
8. Use the HTF Bias Filter:
When this filter is enabled, signals are filtered by the selected higher timeframe condition. This can help focus only on signals aligned with the larger context.
9. Use RSI Squeeze Mode:
When RSI compresses around the midline, momentum is quiet. A release can show when RSI expands away from the compression zone.
10. Use candle color mode as a visual guide:
For beginners, High/Low Structure mode can make the chart easier to read by coloring candles based on simple structure behavior.
────────────────────────────
EXAMPLE USE CASES
────────────────────────────
Example 1: Momentum continuation
RSI is above the midline, the dashboard shows bullish momentum on multiple timeframes, and the HTF filter is bullish. This can help identify conditions where bullish continuation is stronger.
Example 2: Bearish divergence
Price makes a higher high, but RSI makes a lower high. A bearish divergence label appears. If volume confirmation is enabled, the signal must also match the selected volume behavior.
Example 3: Bullish reversal from oversold
RSI moves into oversold territory, then forms a bullish divergence or failure swing. The trader can use this as a warning that downside momentum may be weakening.
Example 4: RSI compression
RSI stays close to the midline and the squeeze background appears. A release signal can appear when RSI moves away from the compression zone.
Example 5: Beginner structure reading
Candle Color Mode is set to High/Low Structure. Candles become easier to read because bullish candles are based on higher highs and higher lows, while bearish candles are based on lower highs and lower lows.
────────────────────────────
BEST PRACTICES
────────────────────────────
Use this indicator as a momentum and context tool, not as a standalone trading system.
Use divergences together with support, resistance, trendlines, liquidity zones, or market structure.
Use higher timeframe confirmation when trading lower timeframes.
Use volume confirmation if you want fewer but more filtered divergence signals.
Avoid relying on signals during low-volume or highly volatile news-driven conditions.
Always test settings on the symbol and timeframe you trade.
────────────────────────────
LIMITATIONS
────────────────────────────
This script is an indicator, not a strategy.
It does not place orders.
It does not guarantee profitable results.
Divergences and failure swings can fail.
Pivot-based signals are confirmed only after the required number of bars.
Multi-timeframe readings depend on the selected timeframes.
Alerts depend on the alert settings selected by the user in TradingView.
Market context remains important. No oscillator should be used alone.
אינדיקטור Pine Script®






















