OPEN-SOURCE SCRIPT
RSI: alternative derivation

Most traders accept the Relative Strength Index (RSI) as a standard tool for measuring momentum. But what if RSI is actually a position indicator?
This script introduces an alternative derivation of RSI, offering a fresh perspective on its true nature. Instead of relying on the traditional calculation of average gains and losses, this approach directly considers the price's position relative to its equilibrium (moving average), adjusted for volatility.
While the final value remains identical to the standard RSI, this alternative derivation offers a completely new understanding of the indicator.
Key components:
Calculation Breakdown
The final equation:
RSI = 50 × [1 + (Price - EMA) / (Volatility × (n-1))]
What This Means for RSI
This script introduces an alternative derivation of RSI, offering a fresh perspective on its true nature. Instead of relying on the traditional calculation of average gains and losses, this approach directly considers the price's position relative to its equilibrium (moving average), adjusted for volatility.
While the final value remains identical to the standard RSI, this alternative derivation offers a completely new understanding of the indicator.
Key components:
- Price (Close)
Utilizes the closing price, consistent with the original RSI formula. - normalization factor
Transforms raw calculations into a fixed range between -1 and +1.Pine Script® normalization_factor = 1 / (Length - 1) - EMA of Price
Applies Wilder’s Exponential Moving Average (EMA) to the price, serving as the anchor point for measuring price position, similar to the traditional RSI formula.Pine Script® myEMA = ta.rma(close,Length) - EMA of close-to-close absolute changes (unit of volatility)
Adjusts for market differences by applying a Wilder’s EMA to absolute price changes (volatility), ensuring consistency across various assets.Pine Script® CC_vol = ta.rma(math.abs(close - close[1]),Length)
Calculation Breakdown
- DISTANCE:
Calculate the difference between the closing price and its Wilder's EMA. A positive value indicates the price is above the EMA; a negative value indicates it is below.Pine Script® distance = close - myEMA - STANDARDIZED DISTANCE
Divide the distance by the unit of volatility to standardize the measurement across different markets.Pine Script® S_distance = distance / CC_vol - NORMALIZED DISTANCE
Normalize the standardized distance using the normalization factor (n-1) to adjust for the lookback period.Pine Script® N_distance = S_distance * normalization_factor - RSI
Finally, scale the normalized distance to fit within the standard RSI range of 0 to 100.Pine Script® myRSI = 50 * (1 + N_distance)
The final equation:
RSI = 50 × [1 + (Price - EMA) / (Volatility × (n-1))]
What This Means for RSI
- Same RSI Values, Different Interpretation
- The standard RSI formula may obscure its true measurement, whereas this approach offers clarity.
- RSI primarily indicates the price's position relative to its equilibrium, rather than directly measuring momentum.
- RSI can still be used to analyze momentum, but in a more intuitive and well-informed way.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.