PROTECTED SOURCE SCRIPT

RSI Crossover and ADX oscillator [deepakks444]

RSI Crossover and ADX Oscillator [deepakks444]
The RSI Crossover and ADX Oscillator is a custom indicator designed to help traders identify potential trend reversals and trend strength by analyzing the Relative Strength Index (RSI) across multiple timeframes, combined with the Average Directional Index (ADX) to measure the momentum of a trend. This indicator provides a more comprehensive view of the market, allowing traders to spot possible entry and exit points based on multiple signals and conditions.

How the Script Works:
1. Multi-Timeframe RSI Calculation:
This indicator calculates the RSI for three different timeframes:

RSI 1 (default: 15 minutes)
RSI 2 (default: 1 hour)
RSI 3 (default: Daily)
By comparing the RSI across multiple timeframes, traders can gauge both short-term and longer-term momentum. For example, if the shorter timeframe RSI is moving in the same direction as the longer timeframe RSI, it may confirm the strength of the trend. Conversely, if they diverge, it could signal a potential reversal or weakening of the trend.

Each RSI value can also be smoothed using a variety of smoothing methods (SMA, EMA, WMA, RMA) to reduce noise and produce cleaner signals.

2. RSI Smoothing Options:
The smoothing function helps make RSI readings clearer by filtering out short-term fluctuations. This can be useful in volatile markets where small movements can trigger false signals. The user can select the preferred smoothing method (or choose none) and set the smoothing factor to control the sensitivity of the RSI line.

None: No smoothing applied.
SMA (Simple Moving Average): Averages RSI over a specified period, providing a more straightforward trend line.
EMA (Exponential Moving Average): Puts more weight on recent data points, making the trend line more responsive to recent price movements.
WMA (Weighted Moving Average): A weighted average that emphasizes more recent values.
RMA (Running Moving Average): Another smoothing option similar to SMA but with different calculation properties.
3. ADX Trend Strength Measurement:
The Average Directional Index (ADX) is used to measure the strength of a trend, regardless of its direction. ADX is a widely used tool to confirm whether the market is trending strongly or if the market is in a sideways range.

ADX > 25: Indicates a strong trend.
ADX < 25: Indicates a weak trend or range-bound market.
In this script, the color of the ADX line changes dynamically based on whether the trend is strengthening (green) or weakening (red). This allows traders to quickly assess whether the market conditions are favorable for trend-following strategies.

4. Divergence Detection:
The script includes an option to detect regular bullish and bearish divergence between price and RSI. Divergence occurs when price moves in one direction but RSI moves in the opposite direction, which may indicate that the current trend is weakening and could be about to reverse.

Bullish Divergence: Occurs when the price makes a lower low, but the RSI makes a higher low. This could signal a potential upward reversal.
Bearish Divergence: Occurs when the price makes a higher high, but the RSI makes a lower high. This could signal a potential downward reversal.
These divergence signals help traders spot potential reversal points before they become obvious on the price chart itself.

5. No-Trade Zone:
The no-trade zone is an important feature of this script. It highlights the range between RSI 40 and 60, which represents a neutral or indecisive market condition. When the RSI is within this range, it indicates that the market lacks clear directional momentum, making it a riskier environment for trend-following trades. The script shades this region on the chart, visually warning traders to avoid initiating trades during these periods.

Visual Table Display:
To improve clarity, the script includes a table that shows key values directly on the chart:

RSI 1 (15-minute): Displays the current RSI value for the 15-minute timeframe.
RSI 2 (1-hour): Displays the current RSI value for the 1-hour timeframe.
RSI 3 (Daily): Displays the current RSI value for the Daily timeframe.
ADX: Displays the current ADX value, with color-coding to show whether the trend is strengthening (green) or weakening (red).
Long/Short Signal: This final cell in the table shows whether a potential Long or Short signal is currently active based on RSI crossovers and ADX strength.
The table can be repositioned on the chart according to user preference (Top Right, Top Left, Bottom Right, Bottom Left).

Possible Entry and Exit Points:
Long Entry Criteria:
RSI 1 crosses above RSI 2.
RSI 1 is above its 9-period moving average (to confirm upward momentum).
When these conditions are met, the script will display a potential Long signal in the table, and an alert will be triggered if enabled.
Note : ADX is rising, indicating that the trend strength is increasing. ADX is falling, indicating that the trend is weakening.

Short Entry Criteria:

RSI 1 (15-minute) crosses below RSI 2 (1-hour).
RSI 1 is below its 9-period moving average (to confirm downward momentum).
Note : ADX is rising, indicating that the trend strength is increasing. ADX is falling, indicating that the trend is weakening.
When these conditions are met, the script will display a potential Short signal in the table, and an alert will be triggered if enabled.

Exit Criteria:
Exit a Long position when a Short signal is generated or when a yellow candle appears, which indicates that momentum is weakening.
Exit a Short position when a Long signal is generated or when a yellow candle appears.
Customizable Inputs:
This script offers several customization options for users:

RSI Length and Timeframes:
Adjust the length of the RSI calculation and the timeframes for each RSI (default: 15-minute, 1-hour, Daily). This allows traders to tailor the script to different market conditions and assets.

Smoothing Method:
Choose how the RSI values are smoothed (None, SMA, EMA, WMA, RMA) and adjust the smoothing factor.

ADX Settings:
Toggle the ADX on/off, and adjust the smoothing factor and DI length to match your preferred trend strength calculation.

Divergence Detection:
Enable or disable divergence detection and set the range of bars for detecting divergence patterns.

Table Position:
Change the location of the table on the chart (Top Right, Top Left, Bottom Right, Bottom Left).

Note : I have used RSI 1 = 3 Minutes, RSI 2 = 15 Minutes and RSI 3 = 1 Hour as input in the shown chart.

Important Notes:
This script is intended for educational purposes only. It is designed to help traders learn how to combine RSI and ADX to analyze trends and momentum, but it should not be used as financial advice or a guaranteed trading strategy.
Always test the script in a demo environment before using it in live trading to understand how it behaves with different assets and timeframes.
Proper risk management and additional confirmations should be used alongside this indicator for effective trading.
Average Directional Index (ADX)Relative Strength Index (RSI)

Script protegido

Este script se publica con código cerrado, pero puede utilizarlo libremente. Márquelo como favorito y podrá usarlo en un gráfico. El código fuente no se puede ver ni modificar.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad