OPEN-SOURCE SCRIPT
Updated

RSI Reverse

860
RSI Reverse is an analytical tool that reverse-engineers the Relative Strength Index (RSI) to project the estimated price levels required to reach your specific Overbought (OB) and Oversold (OS) targets.

Instead of acting solely as a lagging oscillator, this script calculates the mathematical distance price needs to travel over a user-defined number of future bars to push the RSI to your desired levels. (Note: These are mathematical projections based on current calculations, intended to be used as reference levels rather than guaranteed absolute predictions.)

Here is a breakdown of the indicator's configuration:

⚙️ Core Configuration
RSI Length: The lookback period for the base RSI calculation (Default: 14).

Overbought Target (OB): The upper RSI target level you want to project a price for (e.g., 70, 80).

Oversold Target (OS): The lower RSI target level you want to project a price for (e.g., 30, 20).

⏱️ The 5-Scenario Projections (Time Horizons)
Reaching an RSI of 70 on the very next bar requires a significantly different price movement compared to reaching it gradually over 30 bars. To account for this, the script provides 5 independent and fully customizable time scenarios:

Scenario 1 to 5 (Bars): You can define the exact number of bars for each of the 5 scenarios (Default: 1, 5, 14, 30, 60 bars).

The indicator simultaneously calculates and displays the required price to hit your OB/OS targets across all 5 time horizons. This allows you to observe how the target price dynamically shifts depending on how fast or slow the market moves.

🎨 Clean UI Dashboard
To keep your charts clean from visual clutter, all 10 projected target prices are displayed in a compact, non-intrusive table.

Table Position: Choose between Top-Right, Middle-Right, or Bottom-Right to ensure it never blocks your price action.

Text Size: Adjustable from Small to Large to fit your screen setup.

🔬 Under the Hood: Accuracy & Logic
Mathematical Precision: For Scenario 1 (Next Bar), the target is a 100% mathematically exact reverse-calculation. For multi-bar scenarios, the engine does not merely divide the required movement linearly. Instead, it utilizes an advanced ATR (Average True Range) step-distribution to simulate realistic market volatility, yielding a highly logical price estimate rather than a rigid straight line.

The Analytical Limitation: It is crucial to remember that a projected target is a mathematical destination assuming current momentum is maintained. Relying purely on technical analysis from a single timeframe has inherent limitations and can expose you to market noise.

💡 Practical Application & MTFA
Multi-Timeframe Analysis (MTFA): To overcome the limitations of single-timeframe chart analysis, it is highly recommended to combine this tool with MTFA. For example, if your higher-timeframe macro structure is in a bullish trend, look to execute limit buy orders exactly at the projected Oversold (OS) levels on your lower timeframe.

Dynamic Reference Levels: Use the projected prices as dynamic areas of interest to gauge where the market might become mathematically overextended.

Confluence: Combine these projected price matrixes with your existing chart analysis (e.g., support/resistance, order flow, or liquidity blocks) to identify high-probability zones for potential take-profits or limit entries.
Release Notes
v2.0 — Core Logic Rebuild

This update is a full rebuild of the calculation engine rather than a cosmetic revision.

Removed
Removed the previous 1 / 5 / 14 / 30 / 60-bar scenario system
Removed labels such as Trend / Grind / Long / Macro
Removed ATR-based multi-bar RSI simulation
Removed the binary-search-based target solver
Removed future-price projections that depended on assumed multi-bar price paths

The previous multi-bar calculations could produce a single target price even though future RSI depends on the actual sequence of future price changes. Because of this path dependency, those values could be interpreted as more precise than they actually were.

New Calculation Model

RSI Reverse PRO now focuses on one mathematically well-defined question:

At what price must the next candle close for RSI to reach a specific target value?

The calculation is based directly on Wilder's RSI smoothing structure.

Default target levels:

RSI 70
RSI 60
RSI 40
RSI 30

All target RSI levels are customizable.

New Dashboard Data

The table now displays:

Current RSI
Target RSI level
Required next-candle closing price
Price distance from the current close
Percentage distance
ATR distance

This makes it easier to compare RSI thresholds directly in price terms.

Price-Level Visualization

Optional target-price lines can now be displayed directly on the chart.

Each level can include:

RSI target
Calculated target price
Custom color
Custom line width
Custom line style
Right-side extension

Target labels can also be enabled or disabled independently.

Chart Protection

A new Maximum ATR Distance filter prevents extremely distant RSI target levels from compressing the visible chart scale.

If a calculated target exceeds the selected ATR-distance threshold:

The calculation remains available in the dashboard
The corresponding chart line can be automatically hidden

This affects visualization only, not the underlying calculation.

Safety Improvements

The calculation engine now handles invalid or unrealistic outputs more explicitly.

Optional protection is included for:

Negative target prices
Insufficient RSI history
Invalid calculation states

Instead of silently converting unavailable data into zero, unavailable results are treated as unavailable.

Data Window Support

The following values are available in TradingView's Data Window:

Current RSI
RSI 70 target price
RSI 60 target price
RSI 40 target price
RSI 30 target price
Important Interpretation

The displayed target price represents the price required at the next candle close.

For example:

RSI 70 Target = 108,420

means:

If the next candle closes at approximately 108,420, RSI would reach the selected RSI 70 target under the current RSI state.

It does not mean that RSI will necessarily equal 70 whenever price eventually reaches 108,420.

RSI is path-dependent, so the target changes as new candles are formed.

Summary

Previous version

Future multi-bar RSI projection based partly on assumed price behavior.

Current version

Direct next-candle RSI reverse calculation based on Wilder RSI mathematics.

The main goal of this update is to make the indicator simpler, more transparent, and more precise about what its calculated price levels actually represent
Release Notes
Bug fixed

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.