PROTECTED SOURCE SCRIPT

The Alchemist's Codex | Divergences of Multi Length RSI

517
This Pine Script 5 indicator, titled "The Alchemist's Codex - Project La Grande Finale | Slope Loop Based Divergences of Multi Length RSI," is designed to identify potential bullish and bearish divergences between price and a custom-calculated Relative Strength Index (RSI). It aims to provide traders with signals based on the momentum and rate of change of price and RSI.

Here's a breakdown of its functionality:

1. Custom RSI Calculation:

The script begins by calculating a unique RSI variant. It iterates through various lookback periods (from 1 to a user-defined maximum), computing the RSI for each.
It incorporates a dual weighting mechanism, considering both the rate of change and the time elapsed since significant RSI changes. This aims to provide a more nuanced representation of momentum.
The script calculates averages incorporating both slope and time factors.
The calculated RSI values are then again averaged over the defined lookback range to produce a final, smoothed RSI output.

2. Slope Calculation and Divergence Detection:
The script calculates the average slopes of both the price and the custom RSI over a range of lengths (from a minimum to a maximum defined by the user).
It ranks calculations to determine the relative strength of the price and RSI slopes.
It then identifies potential bullish and bearish divergences by comparing the percent ranks of the price and RSI slopes, along with comparing the current price and RSI values to previous values over a short and long lookback.
Bullish divergences occur when the price makes lower lows while the RSI makes higher lows, and when the price slope is very low, and the RSI slope is very high. Additionally it checks that the current price slope is higher than the previous price slope.
Bearish divergences occur when the price makes higher highs while the RSI makes lower highs, and when the price slope is very high, and the RSI slope is very low. Additionally it checks that the current price slope is lower than the previous price slope.

3. Visualizations:

The script plots labels on the chart to indicate bullish and bearish divergences.
It also plots the average price and RSI slopes, allowing traders to visually assess the momentum and direction of both.
Key Input Parameters:

length: Base RSI length.
rsiThreshold: Defines a meaningful change in RSI.
price_source: Source of price data.
minLength, maxLength: Range of lengths for slope calculations.
Low_Percentage_rank, High_Percentage_rank: Percent rank thresholds for divergence detection.
x, z: lookback periods for the bullish and bearish divergence conditions.
mult: A multiplier.
In essence, this indicator combines a custom RSI calculation with slope analysis and percent rank evaluation to identify potential divergences, providing traders with signals based on momentum and relative strength.


anlık görüntü


anlık görüntü

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.