OPEN-SOURCE SCRIPT

WaveTrend With Divs & RSI(STOCH) Divs by WeloTrades

WaveTrend with Divergences & RSI(STOCH) Divergences by WeloTrades
Overview
The "WaveTrend With Divergences & RSI(STOCH) Divergences" is an advanced Pine Script™ indicator designed for TradingView, offering a multi-dimensional analysis of market conditions. This script integrates several technical indicators—WaveTrend, Money Flow Index (MFI), RSI, and Stochastic RSI—into a cohesive tool that identifies both regular and hidden divergences across these indicators. These divergences can indicate potential market reversals and provide critical trading opportunities.

This indicator is not just a simple combination of popular tools; it offers extensive customization options, organized data presentation, and valuable trading signals that are easy to interpret. Whether you're a day trader or a long-term investor, this script enhances your ability to make informed decisions.

Originality and Usefulness
The originality of this script lies in its integration and the synergy it creates among the indicators used. Rather than merely combining multiple indicators, this script allows them to work together, enhancing each other's strengths. For example, by identifying divergences across WaveTrend, RSI, and Stochastic RSI simultaneously, the script provides multiple layers of confirmation, which reduces the likelihood of false signals and increases the reliability of trading signals.

The usefulness of this script is apparent in its ability to offer a consolidated view of market dynamics. It not only simplifies the analytical process by combining different indicators but also provides deeper insights through its divergence detection features. This comprehensive approach is designed to help traders identify potential market reversals, confirm trends, and ultimately make more informed trading decisions.

How the Components Work Together
1. Cross-Validation of Signals
  • WaveTrend: This indicator is primarily used to identify overbought and oversold conditions, as well as potential buy and sell signals. WaveTrend's ability to smooth price data and reduce noise makes it a reliable tool for identifying trend reversals.
  • RSI & Stochastic RSI: These momentum oscillators are used to measure the speed and change of price movements. While RSI identifies general overbought and oversold conditions, Stochastic RSI offers a more granular view by tracking the RSI’s level relative to its high-low range over a period of time. When these indicators align with WaveTrend signals, it adds a layer of confirmation that enhances the reliability of the signals.
  • Money Flow Index (MFI): This volume-weighted indicator assesses the inflow and outflow of money in an asset, giving insights into buying and selling pressure. By analyzing the MFI alongside WaveTrend and RSI indicators, the script can cross-validate signals, ensuring that buy or sell signals are supported by actual market volume.


Example Bullish scenario:
https://www.tradingview.com/x/Frb8sHHF/
When a bullish divergence is detected on the RSI and confirmed by a corresponding bullish signal on the WaveTrend, along with an increasing Money Flow Index, the probability of a successful trade setup increases. This cross-validation minimizes the risk of acting on false signals, which might occur when relying on a single indicator.

Example Bearish scenario:
https://www.tradingview.com/x/zuIx2IXW/
When a bearish divergence is detected on the RSI and confirmed by a corresponding bearish signal on the WaveTrend, along with an decreasing Money Flow Index, the probability of a successful trade setup increases. This cross-validation minimizes the risk of acting on false signals, which might occur when relying on a single indicator.


2. Divergence Detection and Market Reversals
  • Regular Divergences: Occur when the price action and an indicator (like RSI or WaveTrend) move in opposite directions. Regular bullish divergence signals a potential upward reversal when the price makes a lower low while the indicator makes a higher low. Conversely, regular bearish divergence suggests a downward reversal when the price makes a higher high, but the indicator makes a lower high.
  • Hidden Divergences: These occur when the price action and indicator move in the same direction, but with different momentum. Hidden bullish divergence suggests the continuation of an uptrend, while hidden bearish divergence suggests the continuation of a downtrend. By detecting these divergences across multiple indicators, the script identifies potential trend reversals or continuations with greater accuracy.
  • Example:The script might detect a regular bullish divergence on the WaveTrend while simultaneously identifying a hidden bullish divergence on the RSI. This combination suggests that while a trend reversal is possible, the overall market sentiment remains bullish, providing a nuanced view of the market.

A Regular Bullish Divergence Example:
https://www.tradingview.com/x/Zx5etREy/
A Hidden Bullish Divergence Example:
https://www.tradingview.com/x/pvFiwkge/
A Regular Bearish Divergence Example:
https://www.tradingview.com/x/wrlF3IpA/
A Hidden Bearish Divergence Example:
https://www.tradingview.com/x/9clmmoju/


3. Trend Strength and Sentiment Analysis
  • WaveTrend: Measures the strength and direction of the trend. By identifying the extremes of market sentiment (overbought and oversold levels), WaveTrend provides early signals for potential reversals.
  • Money Flow Index (MFI): Assesses the underlying sentiment by analyzing the flow of money. A rising MFI during an uptrend confirms strong buying pressure, while a falling MFI during a downtrend confirms selling pressure. This helps traders assess whether a trend is likely to continue or reverse.
  • RSI & Stochastic RSI: Offer a momentum-based perspective on the trend’s strength. High RSI or Stochastic RSI values indicate that the asset may be overbought, suggesting a potential reversal. Conversely, low values indicate oversold conditions, signaling a possible upward reversal.

Example:
https://www.tradingview.com/x/NMZuSCb2/
During a strong uptrend, the WaveTrend & RSI's might signal overbought conditions, suggesting caution. If the MFI also shows decreasing buying pressure and the RSI reaches extreme levels, these indicators together suggest that the trend might be weakening, and a reversal could be imminent.

Example:
https://www.tradingview.com/x/Gw9rx0Pf/
During a strong downtrend, the WaveTrend & RSI's might signal oversold conditions, suggesting caution. If the MFI also shows increasing buying pressure and the RSI reaches extreme levels, these indicators together suggest that the trend might be weakening, and a reversal could be imminent.


Conclusion
The "WaveTrend With Divergences & RSI(STOCH) Divergences" script offers a powerful, integrated approach to technical analysis by combining trend, momentum, and sentiment indicators into a single tool. Its unique value lies in the cross-validation of signals, the ability to detect divergences, and the comprehensive view it provides of market conditions. By offering traders multiple layers of analysis and customization options, this script is designed to enhance trading decisions, reduce false signals, and provide clearer insights into market dynamics.


WAVETREND

Display of WaveTrend:
https://www.tradingview.com/x/E5ZGaRC9/
Display of WaveTrend Setting:
https://www.tradingview.com/x/BtbbppRv/

WaveTrend Indicator Explanation
The WaveTrend indicator helps identify overbought and oversold conditions, as well as potential buy and sell signals. Its flexibility allows traders to adapt it to various strategies, making it a versatile tool in technical analysis.

WaveTrend Input Settings:

WT MA Source: Default: HLC3

  • What it is: The data source used for calculating the WaveTrend Moving Average.
  • What it does: Determines the input data to smooth price action and filter noise.
  • Example: Using HLC3 (average of High, Low, Close) provides a smoother data representation compared to using just the closing price.


Length (WT MA Length): Default: 3

  • What it is: The period used to calculate the Moving Average.
  • What it does: Adjusts the sensitivity of the WaveTrend indicator, where shorter lengths respond more quickly to price changes.
  • Example: A length of 3 is ideal for short-term analysis, providing quick reactions to price movements.


WT Channel Length & Average: Default: WT Channel Length = 9, Average = 12

  • What it is: Lengths used to calculate the WaveTrend channel and its average.
  • What it does: Smooths out the WaveTrend further, reducing false signals by averaging over a set period.
  • Example: Higher values reduce noise and help in identifying more reliable trends.


Channel: Style, Width, and Color:

  • What it is: Customization options for the WaveTrend channel's appearance.
  • What it does: Adjusts how the channel is displayed, including line style, width, and color.
  • Example: Choosing an area style with a distinct color can make the WaveTrend indicator clearly visible on the chart.


WT Buy & Sell Signals:

  • What it is: Settings to enable and customize buy and sell signals based on WaveTrend.
  • What it does: Allows for the display of buy/sell signals and customization of their shapes and colors.
  • When it gives a Buy Signal: Generated when the WaveTrend line crosses below an oversold level and then rises back, indicating a potential upward price movement.
  • When it gives a Sell Signal: Triggered when the WaveTrend line crosses above an overbought level and then declines, suggesting a possible downward trend.
  • Example: The script identifies these signals based on mean reversion principles, where prices tend to revert to the mean after reaching extremes. Traders can use these signals to time their entries and exits effectively.



WAVETREND OVERBOUGTH AND OVERSOLD LEVELS

Display of WaveTrend with Overbought & Oversold Levels:
https://www.tradingview.com/x/hH7wpSCQ/
Display of WaveTrend Overbought & Oversold Levels Settings:
https://www.tradingview.com/x/AX4DUfdo/

WaveTrend Overbought & Oversold Levels Explanation

WT OB & OS Levels: Default: OB Level 1 = 53, OB Level 2 = 60, OS Level 1 = -53, OS Level 2 = -60
  • What it is: The default overbought and oversold levels used by the WaveTrend indicator to signal potential market reversals.
  • What it does: When the WaveTrend crosses above the OB levels, it indicates an overbought condition, potentially signaling a reversal or selling opportunity. Conversely, when it crosses below the OS levels, it indicates an oversold condition, potentially signaling a reversal or buying opportunity.
  • Example: A trader might use these levels to time entry or exit points, such as selling when the WaveTrend crosses into the overbought zone or buying when it crosses into the oversold zone.


Show OB/OS Levels: Default: True
  • What it is: Toggle options to show or hide the overbought and oversold levels on your chart.
  • What it does: When enabled, these levels will be visually represented on your chart, helping you to easily identify when the market reaches these critical thresholds.
  • Example: Displaying these levels can help you quickly see when the WaveTrend is approaching or has crossed into overbought or oversold territory, allowing for more informed trading decisions.


Line Style, Width, and Color for OB/OS Levels:
  • What it is: Options to customize the appearance of the OB and OS levels on your chart, including line style (solid, dotted, dashed), line width, and color.
  • What it does: These settings allow you to adjust how prominently these levels are displayed on your chart, which can help you better visualize and respond to overbought or oversold conditions.
  • Example: Setting a thicker, dashed line in a contrasting color can make these levels stand out more clearly, aiding in quick visual identification.


Example of Use:
  • Scenario: A trader wants to identify potential selling points when the market is overbought. They set the OB levels at 53 and 60, choosing a solid, red line style to make these levels clear on their chart. As the WaveTrend crosses above 53, they monitor for further price action, and upon crossing 60, they consider initiating a sell order.



WAVETREND DIVERGENCES

Display of WaveTrend Divergence:
https://www.tradingview.com/x/mPSfNH4W/
Display of WaveTrend Divergence Setting:
https://www.tradingview.com/x/vtoMfNJQ/

WaveTrend Divergence Indicator Explanation
The WaveTrend Divergence feature helps identify potential reversal points in the market by highlighting divergences between the price and the WaveTrend indicator. Divergences can signal a shift in market momentum, indicating a possible trend reversal. This component allows traders to visualize and customize divergence detection on their charts.

WaveTrend Divergence Input Settings:

Potential Reversal Range: Default: 28
  • What it is: The number of bars to look back when detecting potential tops and bottoms.
  • What it does: Sets the range for identifying possible reversal points based on historical data.
  • Example: A setting of 28 looks back across the last 28 bars to find reversal points, offering a balance between responsiveness and reliability.


Reversal Minimum LVL OB & OS: Default: OB = 35, OS = -35
  • What it is: The minimum overbought and oversold levels required for detecting potential reversals.
  • What it does: Adjusts the thresholds that trigger a reversal signal based on the WaveTrend indicator.
  • Example: A higher OB level reduces the sensitivity to overbought conditions, potentially filtering out false reversal signals.


Lookback Bar Left & Right: Default: Left = 10, Right = 1
  • What it is: The number of bars to the left and right used to confirm a top or bottom.
  • What it does: Helps determine the position of peaks and troughs in the price action.
  • Example: A larger left lookback captures more extended price action before the peak, while a smaller right lookback focuses on the immediate past.


Lookback Range Min & Max: Default: Min = 5, Max = 60
  • What it is: The minimum and maximum range for the lookback period when identifying divergences.
  • What it does: Fine-tunes the detection of divergences by controlling the range over which the indicator looks back.
  • Example: A wider range increases the chances of detecting divergences across different market conditions.


R.Div Minimum LVL OB & OS: Default: OB = 53, OS = -53
  • What it is: The threshold levels for detecting regular divergences.
  • What it does: Adjusts the sensitivity of the regular divergence detection.
  • Example: Higher thresholds make the detection more conservative, identifying only stronger divergence signals.


H.Div Minimum LVL OB & OS: Default: OB = 20, OS = -20
  • What it is: The threshold levels for detecting hidden divergences.
  • What it does: Similar to regular divergence settings but for hidden divergences, which can indicate potential reversals that are less obvious.
  • Example: Lower thresholds make the hidden divergence detection more sensitive, capturing subtler market shifts.


Divergence Label Options:
  • What it is: Options to display and customize labels for regular and hidden divergences.
  • What it does: Allows users to visually differentiate between regular and hidden divergences using customizable labels and colors.
  • Example: Using different colors and symbols for regular (R) and hidden (H) divergences makes it easier to interpret signals on the chart.


Text Size and Color:
  • What it is: Customization options for the size and color of divergence labels.
  • What it does: Adjusts the readability and visibility of divergence labels on the chart.
  • Example: Larger text size may be preferred for charts with a lot of data, ensuring divergence labels stand out clearly.



FAST & SLOW MONEY FLOW INDEX

Display of Fast & Slow Money Flow:
https://www.tradingview.com/x/Sf7MFEf1/
Display of Fast & Slow Money Flow Setting:
https://www.tradingview.com/x/eZb8Uvs2/

Fast Money Flow Indicator Explanation
The Fast Money Flow indicator helps traders identify the flow of money into and out of an asset over a shorter time frame. By tracking the volume-weighted average of price movements, it provides insights into buying and selling pressure in the market, which can be crucial for making timely trading decisions.

Fast Money Flow Input Settings:

Fast Money Flow: Length: Default: 9
  • What it is: The period used for calculating the Fast Money Flow.
  • What it does: Determines the sensitivity of the Money Flow calculation. A shorter length makes the indicator more responsive to recent price changes, while a longer length provides a smoother signal.
  • Example: A length of 9 is suitable for traders looking to capture quick shifts in market sentiment over a short period.


Fast MFI Area Multiplier: Default: 5
  • What it is: A multiplier applied to the Money Flow area calculation.
  • What it does: Adjusts the size of the Money Flow area on the chart, effectively amplifying or reducing the visual impact of the indicator.
  • Example: A higher multiplier can make the Money Flow more prominent on the chart, aiding in the quick identification of significant money flow changes.


Y Position (Y Pos): Default: 0
  • What it is: The vertical position adjustment for the Fast Money Flow plot on the chart.
  • What it does: Allows you to move the Money Flow plot up or down on the chart to avoid overlap with other indicators.
  • Example: Adjusting the Y Position can be useful if you have multiple indicators on the chart and need to maintain clarity.


Fast MFI Style, Width, and Color:
  • What it is: Customization options for how the Fast Money Flow is displayed on the chart.
  • What it does: Enables you to choose between different plot styles (line or area), set the line width, and select colors for positive and negative money flow.
  • Example: Using different colors for positive (green) and negative (red) money flow helps to visually distinguish between periods of buying and selling pressure.


Slow Money Flow Indicator Explanation
The Slow Money Flow indicator tracks the flow of money into and out of an asset over a longer time frame. It provides a broader perspective on market sentiment, smoothing out short-term fluctuations and highlighting longer-term trends.

Slow Money Flow Input Settings:

Slow Money Flow: Length: Default: 12
  • What it is: The period used for calculating the Slow Money Flow.
  • What it does: A longer period smooths out short-term fluctuations, providing a clearer view of the overall money flow trend.
  • Example: A length of 12 is often used by traders looking to identify sustained trends rather than short-term volatility.


Slow MFI Area Multiplier: Default: 5
  • What it is: A multiplier applied to the Slow Money Flow area calculation.
  • What it does: Adjusts the size of the Money Flow area on the chart, helping to emphasize the indicator’s significance.
  • Example: Increasing the multiplier can help highlight the Money Flow in markets with less volatile price action.


Y Position (Y Pos): Default: 0
  • What it is: The vertical position adjustment for the Slow Money Flow plot on the chart.
  • What it does: Allows for vertical repositioning of the Money Flow plot to maintain chart clarity when used with other indicators.
  • Example: Adjusting the Y Position ensures that the Slow Money Flow indicator does not overlap with other key indicators on the chart.


Slow MFI Style, Width, and Color:
  • What it is: Customization options for the visual display of the Slow Money Flow on the chart.
  • What it does: Allows you to choose the plot style (line or area), set the line width, and select colors to differentiate positive and negative money flow.
  • Example: Customizing the colors for the Slow Money Flow allows traders to quickly distinguish between buying and selling trends in the market.



RSI

Display of RSI:
https://www.tradingview.com/x/Ke4OS4Wc/
Display of RSI Setting:
https://www.tradingview.com/x/B6qCseqY/

RSI Indicator Explanation
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. It is typically used to identify overbought or oversold conditions in the market, providing traders with potential signals for buying or selling.

RSI Input Settings:

RSI Source: Default: Close
  • What it is: The data source used for calculating the RSI.
  • What it does: Determines which price data (e.g., close, open) is used in the RSI calculation, affecting how the indicator reflects market conditions.
  • Example: Using the closing price is standard practice, as it reflects the final agreed-upon price for a given time period.


MA Type (Moving Average Type): Default: SMA
  • What it is: The type of moving average applied to the RSI for smoothing purposes.
  • What it does: Changes the smoothing technique of the RSI, impacting how quickly the indicator responds to price movements.
  • Example: Using an Exponential Moving Average (EMA) will make the RSI more sensitive to recent price changes compared to a Simple Moving Average (SMA).


RSI Length: Default: 14
  • What it is: The period over which the RSI is calculated.
  • What it does: Adjusts the sensitivity of the RSI. A shorter length (e.g., 7) makes the RSI more responsive to recent price changes, while a longer length (e.g., 21) smooths out the indicator, reducing the number of signals.
  • Example: A 14-period RSI is commonly used for identifying overbought and oversold conditions, providing a balance between sensitivity and reliability.


RSI Plot Style, Width, and Color:
  • What it is: Options to customize the appearance of the RSI line on the chart.
  • What it does: Allows you to adjust the visual representation of the RSI, including the line width and color.
  • Example: Setting a thicker line width and a bright color like yellow can make the RSI more visible on the chart, aiding in quick analysis.


Display of RSI with RSI Moving Average:
https://www.tradingview.com/x/2FIGO6gA/

RSI Moving Average Explanation
The RSI Moving Average adds a smoothing layer to the RSI, helping to filter out noise and provide clearer signals. It is particularly useful for confirming trend strength and identifying potential reversals.

RSI Moving Average Input Settings:

MA Length: Default: 14
  • What it is: The period over which the Moving Average is calculated on the RSI.
  • What it does: Adjusts the smoothing of the RSI, helping to reduce false signals and provide a clearer trend indication.
  • Example: A 14-period moving average on the RSI can smooth out short-term fluctuations, making it easier to spot genuine overbought or oversold conditions.


MA Plot Style, Width, and Color:
  • What it is: Customization options for how the RSI Moving Average is displayed on the chart.
  • What it does: Allows you to adjust the line width and color, helping to differentiate the Moving Average from the main RSI line.
  • Example: Using a contrasting color for the RSI Moving Average (e.g., magenta) can help it stand out against the main RSI line, making it easier to interpret the indicator.



STOCHASTIC RSI

Display of Stochastic RSI:
https://www.tradingview.com/x/DhDJlbB5/
Display of Stochastic RSI Setting:
https://www.tradingview.com/x/Z4lUQ2hO/

Stochastic RSI Indicator Explanation
The Stochastic RSI (Stoch RSI) is a momentum oscillator that measures the level of the RSI relative to its high-low range over a set period of time. It is used to identify overbought and oversold conditions, providing potential buy and sell signals based on momentum shifts.

Stochastic RSI Input Settings:

Stochastic RSI Length: Default: 14
  • What it is: The period over which the Stochastic RSI is calculated.
  • What it does: Adjusts the sensitivity of the Stochastic RSI. A shorter length makes the indicator more responsive to recent price changes, while a longer length smooths out the fluctuations, reducing noise.
  • Example: A length of 14 is commonly used to identify momentum shifts over a medium-term period, providing a balanced view of potential overbought or oversold conditions.


Display of Stochastic RSI %K Line:
https://www.tradingview.com/x/Ggo9rGhR/

Stochastic RSI %K Line Explanation
The %K line in the Stochastic RSI is the main line that tracks the momentum of the RSI over the chosen period. It is the faster-moving component of the Stochastic RSI, often used to identify entry and exit points.

Stochastic RSI %K Input Settings:

%K Length: Default: 3
  • What it is: The period used for smoothing the %K line of the Stochastic RSI.
  • What it does: Smoothing the %K line helps reduce noise and provides a clearer signal for potential market reversals.
  • Example: A smoothing length of 3 is common, offering a balance between responsiveness and noise reduction, making it easier to spot significant momentum shifts.


%K Plot Style, Width, and Color:
  • What it is: Customization options for the visual representation of the %K line.
  • What it does: Allows you to adjust the appearance of the %K line on the chart, including line width and color, to fit your visual preferences.
  • Example: Setting a blue color and a medium width for the %K line makes it stand out clearly on the chart, helping to identify key points of momentum change.


%K Fill Color (Above):
  • What it is: The fill color that appears above the %K line on the chart.
  • What it does: Adds visual clarity by shading the area above the %K line, making it easier to interpret the direction and strength of momentum.
  • Example: Using a light blue fill color above the %K line can help emphasize bullish momentum, making it visually prominent.


Display of Stochastic RSI %D Line:
https://www.tradingview.com/x/ckAqWZLz/

Stochastic RSI %D Line Explanation
The %D line in the Stochastic RSI is a moving average of the %K line and acts as a signal line. It is slower-moving compared to the %K line and is often used to confirm signals or identify potential reversals when it crosses the %K line.

Stochastic RSI %D Input Settings:

%D Length: Default: 3
  • What it is: The period used for smoothing the %D line of the Stochastic RSI.
  • What it does: Smooths out the %D line, making it less sensitive to short-term fluctuations and more reliable for identifying significant market signals.
  • Example: A length of 3 is often used to provide a smoothed signal line that can help confirm trends or reversals indicated by the %K line.


%D Plot Style, Width, and Color:
  • What it is: Customization options for the visual representation of the %D line.
  • What it does: Allows you to adjust the appearance of the %D line on the chart, including line width and color, to match your preferences.
  • Example: Setting an orange color and a thicker line width for the %D line can help differentiate it from the %K line, making crossover points easier to spot.


%D Fill Color (Below):
  • What it is: The fill color that appears below the %D line on the chart.
  • What it does: Adds visual clarity by shading the area below the %D line, making it easier to interpret bearish momentum.
  • Example: Using a light orange fill color below the %D line can highlight bearish conditions, making it visually easier to identify.



RSI & STOCHASTIC RSI OVERBOUGHT AND OVERSOLD LEVELS

Display of RSI & Stochastic with Overbought & Oversold Levels:
https://www.tradingview.com/x/yyh2SAuF/
Display of RSI & Stochastic Overbought & Oversold Settings:
https://www.tradingview.com/x/xE2LgcxL/

RSI & Stochastic Overbought & Oversold Levels Explanation
The Overbought (OB) and Oversold (OS) levels for RSI and Stochastic RSI indicators are key thresholds that help traders identify potential reversal points in the market. These levels are used to determine when an asset is likely overbought or oversold, which can signal a potential trend reversal.

RSI & Stochastic Overbought & Oversold Input Settings:

RSI & Stochastic Level 1 Overbought (OB) & Oversold (OS): Default: OB Level = 170, OS Level = 130
  • What it is: The first set of thresholds for determining overbought and oversold conditions for both RSI and Stochastic RSI indicators.
  • What it does: When the RSI or Stochastic RSI crosses above the overbought level, it suggests that the asset might be overbought, potentially signaling a sell opportunity. Conversely, when these indicators drop below the oversold level, it suggests the asset might be oversold, potentially signaling a buy opportunity.
  • Example: If the RSI crosses above 170, traders might look for signs of a potential trend reversal to the downside, while a cross below 130 might indicate a reversal to the upside.


RSI & Stochastic Level 2 Overbought (OB) & Oversold (OS): Default: OB Level = 180, OS Level = 120
  • What it is: The second set of thresholds for determining overbought and oversold conditions for both RSI and Stochastic RSI indicators.
  • What it does: These levels provide an additional set of reference points, allowing traders to differentiate between varying degrees of overbought and oversold conditions, potentially leading to more refined trading decisions.
  • Example: When the RSI crosses above 180, it might indicate an extreme overbought condition, which could be a stronger signal for a sell, while a cross below 120 might indicate an extreme oversold condition, which could be a stronger signal for a buy.


RSI & Stochastic Overbought (OB) Band Customization:

OB Level 1: Width, Style, and Color:
  • What it is: Customization options for the visual appearance of the first overbought band on the chart.
  • What it does: Allows you to set the line width, style (solid, dotted, dashed), and color for the first overbought band, enhancing its visibility on the chart.
  • Example: A dashed red line with medium width can clearly indicate the first overbought level, helping traders quickly identify when this threshold is crossed.


OB Level 2: Width, Style, and Color:
  • What it is: Customization options for the visual appearance of the second overbought band on the chart.
  • What it does: Allows you to set the line width, style, and color for the second overbought band, providing a clear distinction from the first band.
  • Example: A dashed red line with a slightly thicker width can represent a more significant overbought level, making it easier to differentiate from the first level.



RSI & Stochastic Oversold (OS) Band Customization:

OS Level 1: Width, Style, and Color:
  • What it is: Customization options for the visual appearance of the first oversold band on the chart.
  • What it does: Allows you to set the line width, style (solid, dotted, dashed), and color for the first oversold band, making it visually prominent.
  • Example: A dashed green line with medium width can highlight the first oversold level, helping traders identify potential buying opportunities.


OS Level 2: Width, Style, and Color:
  • What it is: Customization options for the visual appearance of the second oversold band on the chart.
  • What it does: Allows you to set the line width, style, and color for the second oversold band, providing an additional visual cue for extreme oversold conditions.
  • Example: A dashed green line with a thicker width can represent a more significant oversold level, offering a stronger visual cue for potential buying opportunities.



RSI DIVERGENCES

Display of RSI Divergence Labels:
https://www.tradingview.com/x/1VnOWfe9/
Display of RSI Divergence Settings:
https://www.tradingview.com/x/xyE7Ee8S/

RSI Divergence Lookback Explanation

The RSI Divergence settings allow traders to customize the parameters for detecting divergences between the RSI (Relative Strength Index) and price action. Divergences occur when the price moves in the opposite direction to the RSI, potentially signaling a trend reversal. These settings help refine the accuracy of divergence detection by adjusting the lookback period and range. ( NOTE: This setting only imply to the RSI. This doesn't effect the STOCHASTIC RSI.)

RSI Divergence Lookback Input Settings:

Lookback Left: Default: 10
  • What it is: The number of bars to look back from the current bar to detect a potential divergence.
  • What it does: Defines the left-side lookback period for identifying pivot points in the RSI, which are used to spot divergences. A longer lookback period may capture more significant trends but could also miss shorter-term divergences.
  • Example: A setting of 10 bars means the script will consider pivot points up to 10 bars before the current bar to check for divergence patterns.


Lookback Right: Default: 1
  • What it is: The number of bars to look forward from the current bar to complete the divergence pattern.
  • What it does: Defines the right-side lookback period for confirming a potential divergence. This setting helps ensure that the identified divergence is valid by allowing the script to check subsequent bars for confirmation.
  • Example: A setting of 1 bar means the script will look at the next bar to confirm the divergence pattern, ensuring that the signal is reliable.


Lookback Range Min: Default: 5
  • What it is: The minimum range of bars required to detect a valid divergence.
  • What it does: Sets a lower bound on the range of bars considered for divergence detection. A lower minimum range might capture more frequent but possibly less significant divergences.
  • Example: Setting the minimum range to 5 ensures that only divergences spanning at least 5 bars are considered, filtering out very short-term patterns.


Lookback Range Max: Default: 60
  • What it is: The maximum range of bars within which a divergence can be detected.
  • What it does: Sets an upper bound on the range of bars considered for divergence detection. A larger maximum range might capture more significant divergences but could also include less relevant long-term patterns.
  • Example: Setting the maximum range to 60 bars allows the script to detect divergences over a longer timeframe, capturing more extended divergence patterns that could indicate major trend reversals.


RSI Divergence Explanation
RSI divergences occur when the RSI indicator and price action move in opposite directions, signaling potential trend reversals. This section of the settings allows traders to customize the appearance and detection of both regular and hidden bullish and bearish divergences.

RSI Divergence Input Settings:

R. Bullish Div Label: Default: True
  • What it is: An option to display labels for regular bullish divergences.
  • What it does: Enables or disables the visibility of labels that mark regular bullish divergences, where the price makes a lower low while the RSI makes a higher low, indicating a potential upward reversal.
  • Example: A trader might use this to spot buying opportunities in a downtrend when a bullish divergence suggests the trend may be reversing.


Bullish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of regular bullish divergence labels.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: Selecting a green label color and a distinct line width makes bullish divergences easily recognizable on your chart.


R. Bearish Div Label: Default: True
  • What it is: An option to display labels for regular bearish divergences.
  • What it does: Enables or disables the visibility of labels that mark regular bearish divergences, where the price makes a higher high while the RSI makes a lower high, indicating a potential downward reversal.
  • Example: A trader might use this to spot selling opportunities in an uptrend when a bearish divergence suggests the trend may be reversing.


Bearish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of regular bearish divergence labels.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: Choosing a red label color and a specific line width makes bearish divergences clearly stand out on your chart.


H. Bullish Div Label: Default: False
  • What it is: An option to display labels for hidden bullish divergences.
  • What it does: Enables or disables the visibility of labels that mark hidden bullish divergences, where the price makes a higher low while the RSI makes a lower low, indicating potential continuation of an uptrend.
  • Example: A trader might use this to confirm an existing uptrend when a hidden bullish divergence signals continued buying strength.


Hidden Bullish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of hidden bullish divergence labels.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: A softer green color with a thinner line width might be chosen to subtly indicate hidden bullish divergences, keeping the chart clean while providing useful information.


H. Bearish Div Label: Default: False
  • What it is: An option to display labels for hidden bearish divergences.
  • What it does: Enables or disables the visibility of labels that mark hidden bearish divergences, where the price makes a lower high while the RSI makes a higher high, indicating potential continuation of a downtrend.
  • Example: A trader might use this to confirm an existing downtrend when a hidden bearish divergence signals continued selling pressure.


Hidden Bearish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of hidden bearish divergence labels.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: A muted red color with a thinner line width might be selected to indicate hidden bearish divergences without overwhelming the chart.


Divergence Text Size and Color: Default: S (Small)
  • What it is: Settings to adjust the size and color of text labels for RSI divergences.
  • What it does: Allows you to customize the size and color of text labels that display the divergence information on the chart.
  • Example: Choosing a small text size with a bright white color can make divergence labels easily readable without taking up too much space on the chart.



STOCHASTIC DIVERGENCES

Display of Stochastic RSI Divergence Labels:
https://www.tradingview.com/x/DMivL3vw/
Display of Stochastic RSI Divergence Settings:
https://www.tradingview.com/x/Z3r0ug6G/

Stochastic RSI Divergence Explanation
Stochastic RSI divergences occur when the Stochastic RSI indicator and price action move in opposite directions, signaling potential trend reversals. These settings allow traders to customize the detection and visual representation of both regular and hidden bullish and bearish divergences in the Stochastic RSI.

Stochastic RSI Divergence Input Settings:

R. Bullish Div Label: Default: True
  • What it is: An option to display labels for regular bullish divergences in the Stochastic RSI.
  • What it does: Enables or disables the visibility of labels that mark regular bullish divergences, where the price makes a lower low while the Stochastic RSI makes a higher low, indicating a potential upward reversal.
  • Example: A trader might use this to spot buying opportunities in a downtrend when a bullish divergence in the Stochastic RSI suggests the trend may be reversing.


Bullish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of regular bullish divergence labels in the Stochastic RSI.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: Selecting a blue label color and a distinct line width makes bullish divergences in the Stochastic RSI easily recognizable on your chart.


R. Bearish Div Label: Default: True
  • What it is: An option to display labels for regular bearish divergences in the Stochastic RSI.
  • What it does: Enables or disables the visibility of labels that mark regular bearish divergences, where the price makes a higher high while the Stochastic RSI makes a lower high, indicating a potential downward reversal.
  • Example: A trader might use this to spot selling opportunities in an uptrend when a bearish divergence in the Stochastic RSI suggests the trend may be reversing.


Bearish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of regular bearish divergence labels in the Stochastic RSI.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: Choosing an orange label color and a specific line width makes bearish divergences in the Stochastic RSI clearly stand out on your chart.


H. Bullish Div Label: Default: False
  • What it is: An option to display labels for hidden bullish divergences in the Stochastic RSI.
  • What it does: Enables or disables the visibility of labels that mark hidden bullish divergences, where the price makes a higher low while the Stochastic RSI makes a lower low, indicating potential continuation of an uptrend.
  • Example: A trader might use this to confirm an existing uptrend when a hidden bullish divergence in the Stochastic RSI signals continued buying strength.


Hidden Bullish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of hidden bullish divergence labels in the Stochastic RSI.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: A softer blue color with a thinner line width might be chosen to subtly indicate hidden bullish divergences, keeping the chart clean while providing useful information.


H. Bearish Div Label: Default: False
  • What it is: An option to display labels for hidden bearish divergences in the Stochastic RSI.
  • What it does: Enables or disables the visibility of labels that mark hidden bearish divergences, where the price makes a lower high while the Stochastic RSI makes a higher high, indicating potential continuation of a downtrend.
  • Example: A trader might use this to confirm an existing downtrend when a hidden bearish divergence in the Stochastic RSI signals continued selling pressure.


Hidden Bearish Label Color, Line Width, and Line Color:
  • What it is: Settings to customize the appearance of hidden bearish divergence labels in the Stochastic RSI.
  • What it does: Allows you to choose the color of the labels, adjust the width of the divergence lines, and select the color for these lines.
  • Example: A muted orange color with a thinner line width might be selected to indicate hidden bearish divergences without overwhelming the chart.


Divergence Text Size and Color: Default: S (Small)
  • What it is: Settings to adjust the size and color of text labels for Stochastic RSI divergences.
  • What it does: Allows you to customize the size and color of text labels that display the divergence information on the chart.
  • Example: Choosing a small text size with a bright white color can make divergence labels easily readable without taking up too much space on the chart.



Alert System:

Custom Alerts for Divergences and Reversals:
  • What it is: The script includes customizable alert conditions to notify you of detected divergences or potential reversals based on WaveTrend, RSI, and Stochastic RSI.
  • What it does: Helps you stay informed of key market movements without constantly monitoring the charts, enabling timely decisions.
  • Example: Setting an alert for regular bearish divergence on the WaveTrend could notify you of a potential sell opportunity as soon as it is detected.


How to Use Alerts:
Set up custom alerts in TradingView based on these conditions to be notified of potential trading opportunities. Alerts are triggered when the indicator detects conditions that match the selected criteria, such as divergences or potential reversals.


By following the detailed guidelines and examples above, you can effectively use and customize this powerful indicator to suit your trading strategy.

For further understanding and customization, refer to the input settings within the script and adjust them to match your trading style and preferences.

How Components Work Together
  • Synergy and Cross-Validation: The indicator combines multiple layers of analysis to validate trading signals. For example, a WaveTrend buy signal that coincides with a bullish divergence in RSI and positive fast money flow is likely to be more reliable than any single indicator’s signal. This cross-validation reduces the likelihood of false signals and enhances decision-making.
  • Comprehensive Market Analysis: Each component plays a role in analyzing different aspects of the market. WaveTrend focuses on trend strength, Money Flow indicators assess market sentiment, while RSI and Stochastic RSI offer detailed views of price momentum and potential reversals.


Ideal For
  • Traders who require a reliable, multifaceted tool for detecting market trends and reversals.
  • Investors seeking a deeper understanding of market dynamics across different timeframes and conditions, whether in forex, equities, or cryptocurrency markets.
  • This script is designed to provide a comprehensive tool for technical analysis, combining multiple indicators and divergence detection into one versatile and customizable script. It is especially useful for traders who want to monitor various indicators simultaneously and look for convergence or divergence signals across different technical tools.


Acknowledgements
Special thanks to these amazing creators for inspiration and their creations:
I want to thank these amazing creators for creating there amazing indicators , that inspired me and also gave me a head start by making this indicator! Without their amazing indicators it wouldn't be possible!


  • vumanchu: VuManChu Cipher B Divergences.
  • MisterMoTa: RSI + Divergences + Alerts [MisterMoTa].
  • DevLucem:Plain Stochastic Divergence.


Note
This indicator is designed to be a powerful tool in your trading arsenal. However, it is essential to backtest and adjust the settings according to your trading strategy before applying it to live trading. If you have any questions or need further assistance, feel free to reach out.
Money Flow Index (MFI)moneyflowindexoverboughtoversoldRelative Strength Index (RSI)reversalrsidivergencesstochasticdivergencestochastic-rsiStochastic RSI (STOCH RSI)wavetrend

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明