OPEN-SOURCE SCRIPT
تم تحديثه

Cyclic RSI + Cyclic Stochastics

28
This script is a custom technical indicator designed to combine the concepts of Cyclically Smoothed RSI (cRSI) with a Cyclic Stochastic Oscillator, integrating advanced features such as Moving Average (MA) customization, divergence detection, and dynamic overbought/oversold levels. The indicator is based on the principles outlined in the book Decoding The Hidden Market Rhythm - Part 1: Dynamic Cycles (2017), specifically focusing on fine-tuning the cRSI for more detailed analysis.

Key Components of the Indicator
Cyclically Smoothed RSI (cRSI):

The cRSI is a smoothed version of the traditional RSI, adjusted for cyclic behavior. It takes into account the dominant market cycle (domcycle) and applies a smoothing factor (vibration) to reduce noise.

These concepts are integral to understanding how the inputs for the Cyclically Smoothed RSI (cRSI) operates within the indicator:

1. Dominant Cycle (domcycle):
Definition: The dominant cycle refers to the primary market cycle or period length that is most influential in the current price movement. In essence, it's the cycle that best captures the market's rhythm or oscillation over a given time frame.
Purpose: The dominant cycle is used to define the length of the cRSI, determining how far back the indicator looks when calculating price momentum. This allows the cRSI to adapt to the market's natural ebb and flow.
Calculation: The domcycle input sets the length of the cycle (typically a number of bars), which is then halved to create a cyclelen that drives the smoothing of the RSI.
Usage: The choice of the dominant cycle length is crucial. If set too short, the indicator may become too sensitive to minor price fluctuations. If set too long, it may not respond quickly enough to changes in market conditions. Traders need to identify the most relevant cycle for their specific market and timeframe.
2. Vibration:
Definition: Vibration refers to the sensitivity and responsiveness of the cRSI to changes in price. It influences how quickly the cRSI adjusts to new market conditions and can be thought of as a smoothing factor.
Purpose: Vibration controls the "torque" of the cRSI, which determines how much weight is given to the most recent price data versus older data. A lower vibration value makes the cRSI more sensitive (reactive), while a higher value makes it smoother (less reactive).
Calculation: The torque is calculated as 2.0 / (vibration + 1), where a lower vibration value increases the torque, leading to a faster response in the cRSI.
Usage: Adjusting the vibration allows traders to fine-tune the balance between responsiveness and smoothness. High vibration (low sensitivity) is useful in trending markets to avoid noise, while low vibration (high sensitivity) is better for capturing quick reversals in volatile markets.
3. Leveling:
Definition: Leveling is a percentage-based input that adjusts the sensitivity of the dynamic overbought and oversold levels calculated by the cRSI. It influences how these levels are determined based on the range of past cRSI values.
Purpose: Leveling helps to normalize the overbought and oversold thresholds based on historical price data, making the indicator adaptive to current market conditions. It prevents the cRSI from issuing too many false signals by adjusting these levels dynamically.
Calculation: The leveling percentage is used to calculate aperc, which is then applied to the cyclic memory to determine the oversold (db) and overbought (ub) levels.
Usage: Traders can adjust the leveling input to control how strict or lenient the overbought/oversold conditions are. Higher leveling percentages make the conditions more stringent, reducing the likelihood of false signals.
4. Cyclic Memory:
Definition: Cyclic memory refers to the lookback period over which the indicator calculates its dynamic overbought and oversold levels. It typically represents twice the length of the dominant cycle, allowing the indicator to capture the full range of cyclical price movements.
Purpose: The cyclic memory determines how much historical data is used to calculate the range within which the cRSI operates. This helps the indicator adapt to different phases of the market cycle.
Calculation: The cyclic memory is typically set to domcycle * 2, and it influences the loop that calculates the highest (lmax) and lowest (lmin) cRSI values over this period.
Usage: A longer cyclic memory makes the indicator more stable and less prone to reacting to short-term fluctuations, while a shorter cyclic memory makes it more responsive but possibly more prone to noise.
5. Phasing Lag:
Definition: Phasing lag is a delay introduced to the cRSI calculation to help reduce market noise and smooth out the indicator's response. It represents the amount of lag introduced to the RSI calculation before it's smoothed by the torque factor.
Purpose: The phasing lag allows the indicator to filter out short-term fluctuations that may not be significant in the context of the dominant cycle. This results in a smoother cRSI that better captures the underlying trend.
Calculation: The phasing lag is applied by delaying the RSI calculation by a number of bars (based on the phasing lag value) before applying the torque smoothing. It’s calculated as (vibration - 1) / 2.0.
Usage: Adjusting the phasing lag can help traders reduce the impact of market noise on the indicator, making it more reliable for identifying true turning points. A higher phasing lag reduces the indicator’s responsiveness but enhances its accuracy in trending markets.
Summary of Interactions:
Dominant Cycle sets the overall context for the indicator, defining the length of time over which market cycles are analyzed.
Vibration fine-tunes the sensitivity of the cRSI, controlling how quickly it reacts to changes in market conditions.
Leveling dynamically adjusts the thresholds for overbought and oversold conditions, based on historical data.
Cyclic Memory determines the lookback period, ensuring the indicator considers enough data to make accurate predictions.
Phasing Lag smooths out the indicator’s response by introducing a delay, helping to filter out noise.
By understanding and adjusting these parameters, traders can tailor the cRSI indicator to better suit their specific trading style and the characteristics of the market they are analyzing.
ملاحظات الأخبار
standard RSI to cRSI
ملاحظات الأخبار
Fibonacci Levels with Gradient Fills
Purpose:
Fibonacci retracement levels are used to identify potential support and resistance zones in the market. These levels are calculated based on the high and low points of the cRSI, providing dynamic and relevant levels that reflect the current market conditions.

How It Works:

Dynamic Levels: The Fibonacci levels are recalculated based on the most recent high and low of the cRSI, ensuring that the levels are always relevant to the current market context.
Color-Coded Zones: Each Fibonacci level is color-coded, with gradient fills between them to visually represent the zones of potential support and resistance.
Application in Trading:

Support and Resistance: Traders can use these levels to identify areas where the price might reverse or experience significant buying or selling pressure.
Confluence with Other Indicators: Look for confluence between Fibonacci levels and other signals from the HMA, PMax, or T3. For example, if a PMax crossover occurs near a Fibonacci level, this could strengthen the signal.
ADX and DMI (Directional Movement Index)
Purpose:
ADX (Average Directional Index) measures the strength of a trend, while DMI (Directional Movement Index) helps identify whether the trend is bullish or bearish.

How It Works:

ADX: Ranges from 0 to 100, with values above 25 typically indicating a strong trend. Lower values suggest a weak or non-trending market.
DMI: Consists of two lines, +DI and -DI. When +DI is above -DI, the market is considered to be in a bullish trend. When -DI is above +DI, the market is considered to be in a bearish trend.
Application in Trading:

Trend Strength Assessment: Use ADX to assess whether the current trend is strong enough to justify a trade. A rising ADX combined with a PMax or T3 crossover can indicate a powerful trend worth trading.
Bullish/Bearish Confirmation: DMI can help confirm the direction of the trend. If +DI is above -DI and the ADX is rising, it suggests a strong bullish trend. Conversely, a rising ADX with -DI above +DI indicates a strong bearish trend.
Williams VixFix
Purpose:
The Williams VixFix is designed to replicate the VIX (Volatility Index) for individual assets, providing insights into market volatility and potential reversal points.

How It Works:

Volatility Measurement: The VixFix measures the relative distance between the highest close and the current low, normalized over a specific period. This helps identify when the market is in a state of extreme fear (potential bottom) or complacency (potential top).
Bollinger Bands: The indicator also includes Bollinger Bands, which are used to identify extreme conditions relative to the VixFix readings.
Application in Trading:

Reversal Signals: Look for signals when the VixFix crosses above or below the upper Bollinger Band. A move above suggests extreme volatility and potential for a reversal, while a move below indicates the market may be settling down.
Filtered Entries: Combine VixFix signals with other indicators like PMax, T3, or ADX/DMI to filter out false signals and confirm potential reversal points.
Divergence Detection
Purpose:
Divergence between the price and the cRSI is a powerful tool for identifying potential reversals. The indicator detects both regular and hidden divergences.

How It Works:

Regular Divergence: Occurs when the price makes a new high (or low) but the cRSI does not, indicating a potential reversal.
Hidden Divergence: Occurs when the cRSI makes a new high (or low) but the price does not, suggesting that the trend may continue.
Application in Trading:

Trend Reversals: Use divergence signals to anticipate trend reversals. A regular bullish divergence could signal the end of a downtrend, while a bearish divergence could signal the end of an uptrend.
Hidden Divergence: Use hidden divergences to confirm trend continuation. For instance, if you are in a long position, a hidden bullish divergence might suggest the trend will continue upward.
Conclusion
This indicator is a comprehensive tool that integrates multiple technical analysis methods to help traders identify trends, support and resistance levels, trend strength, volatility, and potential reversal points. By combining the HMA, PMax, T3, Fibonacci levels, ADX, DMI, VixFix, and divergence detection, traders can gain a holistic view of the market and make informed trading decisions.

Whether you're using the HMA to identify trends, the PMax and T3 for entries and exits, Fibonacci levels for support and resistance, ADX and DMI for trend strength, or VixFix and divergence for reversal signals, this indicator provides a robust framework for various trading strategies.
ملاحظات الأخبار
Cyclic Stochastic Oscillator:

The Cyclic Stochastic is calculated using the cRSI values, providing a %K and %D line. This oscillator helps identify overbought and oversold conditions within the cyclic context.
Inputs:
stochLength: Length of the Stochastic calculation.
%K Smoothing and %D Smoothing: Control the smoothing of the Stochastic lines.
Usage: The Stochastic Oscillator identifies potential reversal points, with overbought and oversold conditions typically indicated by %K and %D crossovers.
Moving Average Customization:

The indicator allows for various types of moving averages to be applied to the cRSI, including SMA, EMA, Bollinger Bands, SMMA, WMA, and VWMA.
Usage: The choice of moving average can significantly impact the interpretation of the cRSI, providing flexibility for different trading strategies.
Dynamic Overbought/Oversold Levels:

The script dynamically calculates overbought and oversold levels based on the cyclic memory, offering a more adaptive approach to identifying market extremes.
Usage: These levels are more responsive to market conditions compared to fixed levels, providing more timely signals.
Divergence Detection:

The indicator includes logic for detecting regular and hidden bullish and bearish divergences using the cRSI. Divergences occur when the price and the oscillator move in opposite directions, indicating potential trend reversals.
Usage: Divergence signals can be used as early warnings for potential market reversals, especially when confirmed by other indicators or price action.
Fibonacci Levels:

Fibonacci levels are plotted for further analysis, providing potential support and resistance levels based on historical price movements.
Usage: These levels help in identifying potential reversal or continuation zones.
Directional Movement Index (DMI) and ADX:

The script includes a DMI and ADX component to assess the strength of trends. It highlights whether a trend is strong, weak, or non-existent.
Usage: ADX readings can be used to confirm the strength of signals generated by the cRSI and Stochastic.
Hull Moving Average (HMA):

A Hull Moving Average (HMA) is integrated into the script, offering a smoother and more responsive moving average compared to traditional ones.
Usage: The HMA can be used to identify trend direction, with crossovers indicating potential entry or exit points.
Williams VIX Fix (VixFix):

The Williams Vix Fix (VixFix) is a volatility indicator included in the script, which identifies potential market bottoms or tops by comparing the current price to the highest price within a given period.
Usage: VixFix signals can be used in conjunction with the cRSI and Stochastic to confirm extreme market conditions and potential reversals.
How to Use the Indicator
Identifying Cyclic Trends and Reversals:

Use the cRSI to identify the general momentum within the dominant cycle. When the cRSI is overbought or oversold, look for potential reversals, especially when confirmed by the Cyclic Stochastic Oscillator.
Divergence Signals:

Pay attention to divergence signals generated by the cRSI. These can be strong indicators of an impending reversal, especially when the ADX confirms a weakening trend.
Moving Averages and Dynamic Levels:

Choose a moving average type that aligns with your trading strategy. For instance, Bollinger Bands can help identify volatility squeezes, while the EMA might be better for trending markets.
Monitor the dynamic overbought/oversold levels for potential entry and exit points.
Directional Movement and ADX:

Use the DMI and ADX readings to gauge the strength of the trend. Strong ADX readings (above 25) indicate a robust trend, where you might want to follow the trend rather than counter it.
Volatility and Market Extremes:

The VixFix component can be used to identify extreme market conditions. When the VixFix signals align with overbought/oversold conditions on the cRSI, it could be a strong signal for a potential reversal.
Fibonacci Levels:

Use the plotted Fibonacci levels to identify potential support and resistance zones. These levels can serve as additional confirmation for entry or exit points.
Conclusion
This indicator is a comprehensive tool that combines multiple advanced techniques to provide a detailed analysis of market cycles, momentum, trend strength, and volatility. It is particularly useful for traders who want to fine-tune their entries and exits based on cyclical analysis and dynamic market conditions. The various components of the indicator can be used in combination to confirm signals and reduce the likelihood of false signals, leading to more informed trading decisions.
ملاحظات الأخبار
Added crossover and crossunder signals.
ملاحظات الأخبار
Improved the stochD crossover signals

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.