🔹 Components and How They Work Together
1. Normalized RSI Calculation: The traditional RSI is calculated using the `ta.rsi()` function. This RSI value is then normalized between -1 and 1 using the highest and lowest RSI values over a user-defined lookback period. This normalization process allows for easier comparison of RSI values across different instruments and timeframes, as it removes the arbitrary scaling of the standard RSI. The formula used for normalization is: `Norm = 2 * ((kaynak - Min) / (Max - Min)) - 1` where `rsi` is the RSI value, `Min` is the lowest RSI value over the lookback period, and `Max` is the highest RSI value over the lookback period.
2. Trend and Center Lines: A trendline is calculated using linear regression (`ta.linreg()`) applied to the normalized RSI. This line represents the overall trend direction of the normalized RSI. An adaptive moving average (ALMA) (`ta.alma()`) is also calculated and plotted as a center line. The ALMA is used to smooth the normalized RSI and provide a more dynamic representation of the trend compared to a simple moving average. The trendline and center line work together to visualize the trend and its deviations. The normalized RSI is smoothed using a weighted moving average (`ta.wma()`) and standard deviation (`ta.stdev()`) before the linear regression is applied. This further refines the trend representation.
3. Divergence Detection: The script identifies both regular and hidden bullish and bearish divergences between the normalized RSI and price action. Pivot points are detected using `ta.pivothigh()` and `ta.pivotlow()` over a user-defined range. Divergences are identified by comparing the pivot points and corresponding normalized RSI values. For example, a bullish divergence is detected when the price makes a lower low while the normalized RSI makes a higher low. These divergences are then marked on the chart with labels.
🔹 Features
* Normalized RSI: Provides a consistent momentum indicator.
* Trendline and Center Line: Visualizes the overall trend direction and potential deviations.
* Divergence Detection: Identifies potential trend reversal points.
* Customizable Parameters: Allows users to adjust the signal period, lookback range, trend length, and divergence sensitivity to optimize the indicator for different trading strategies and market conditions.
🔹 How to Use
1. Trend Following: Use the trendline to identify the overall direction of the normalized RSI. A rising trendline suggests upward momentum, while a falling trendline suggests downward momentum.
2. Divergence Signals:
* 🟢 Bullish Divergence: Potential upward reversal.
* 🔴 Bearish Divergence: Potential downward reversal.
* 🟩 Hidden Bullish Divergence: Trend continuation signal.
* 🟧 Hidden Bearish Divergence: Trend continuation signal.
3. Combined Analysis: Use the normalized RSI, trendline, center line, and divergence signals together to make informed trading decisions. For example, a bullish divergence occurring near a rising trendline could signal a strong potential upward move.
🔹What's new with this update?
The "Divergence selection" section has been added to allow the user to choose between "RSI" (standard) and "Normalized RSI" as the divergence detection indicator.