umagoma

RSI Divergence Alerts

Indicator Description: RSI Divergence Alerts

The RSI Divergence indicator is a technical analysis tool that identifies divergences between the Relative Strength Index (RSI) and the price of an asset. The RSI is a momentum indicator that measures the speed and magnitude of recent changes in an asset's price, while divergences occur when there is a disparity between price movements and the RSI.

Indicator Customization:

Overbought and Oversold: The indicator allows you to customize the overbought and oversold levels of the RSI. This allows traders to adjust parameters according to their preferences and the historical behavior of the asset in question.
Indicator Settings and Recommended Adjustments:

Max Bar Distance: This parameter determines the maximum distance allowed between two low or high points for a divergence to be recognized. A higher value may result in more signals, but may also increase the number of false signals. It is recommended to adjust this value based on the volatility of the asset and the time period in which it is being traded.

RSI Length: This is the time period used to calculate the RSI. A longer period smoothes the indicator, while a shorter period makes it more sensitive to price changes. The default value is 14, but traders can adjust it based on their trading strategy and the asset's volatility.

RSI Overbought and Oversold: These values determine the levels at which the RSI is considered overbought and oversold, respectively. The default value for overbought is 75 and for oversold is 35. Traders can adjust these values according to the asset's volatility and its historical analysis. For example, in more volatile assets, it may be useful to use more extreme levels, such as 80 for overbought and 20 for oversold.

When adjusting indicator settings, traders must consider the balance between sensitivity and accuracy. Careful tuning of these parameters can help filter out false signals and identify more reliable trading opportunities.

The alerts functionality in this RSI Divergence indicator is designed to notify traders when a bearish divergence or a bullish divergence is detected. Here's how it works:

Conditionally Triggered Alerts:

Alerts are triggered based on the boolean variables bearishDivergence and bullishDivergence.
If bearishDivergence is true, it indicates that a bearish divergence has been detected.
If bullishDivergence is true, it indicates that a bullish divergence has been detected.

Alert Message:

When a divergence is detected, an alert message is generated to inform the trader about the event.
The message includes details about the divergence, such as the difference in the RSI value between the two points forming the divergence.
For example, for a bearish divergence, the message will include the phrase "Bearish RSI Divergence Detected" and the RSI difference between the high and low points of the divergence.

Alert Frequency:

Alerts are configured to be triggered once per bar close (alert.freq_once_per_bar_close), which means the alert will only be sent once at the close of each bar.
This helps to avoid multiple alerts for the same divergence during the same time period.

Additional Alert Conditions:

In addition to conditionally triggered alert messages, alert conditions are defined for both bearish and bullish divergences.
These alert conditions are useful for configuring custom alerts on trading platforms that support running Pine Script code.
Overall, this alert functionality allows traders to stay informed about potential trading opportunities based on divergences detected by the indicator. This can help traders make faster and more informed decisions in their trading processes.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?