OPEN-SOURCE SCRIPT
Atualizado

ZenAlgo - Q

1 778
ZenAlgo - Q

Description
ZenAlgo - Q is an oscillator based on the QQE (Quantitative Qualitative Estimation) method. This version incorporates refinements for additional visualization and interpretation options. It is designed to help traders observe momentum changes and divergence patterns in price movements.

Key Features
  • QQE-Based Calculation: Derived from the open-source QQE script by Glaz (Metastock Version of QQE), with modifications for alternative visualization.
  • Dual RSI-Based Analysis: Uses two RSI calculations to provide additional context on price movements.
  • Adaptive Trend Bands: Adjust dynamically based on the market conditions.
  • Divergence Identification: Highlights potential differences between price action and oscillator movement.
  • Dynamic Color Coding: Displays histogram bars to illustrate shifts in oscillator values.
  • Configurable Alerts: Enables notifications for specific oscillator conditions.


How It Works
  • The indicator calculates a smoothed RSI-based oscillator that tracks the relative strength of price movement. It applies an exponential moving average (EMA) smoothing to reduce noise while maintaining responsiveness.
  • Two adaptive bands are calculated using a variation of the QQE method, which helps define dynamic overbought and oversold conditions.
  • The histogram bars shift in color based on the position of the oscillator relative to the bands. Lighter shades indicate weaker momentum, while stronger momentum is represented by more saturated colors.
  • The script also includes a secondary RSI component, which provides an additional layer of analysis. This secondary RSI helps refine momentum trends by smoothing out short-term fluctuations.
  • Divergence identification is built-in, highlighting where price action deviates from oscillator readings. Bullish divergence occurs when price forms a lower low while the oscillator forms a higher low, and bearish divergence is identified when price forms a higher high while the oscillator forms a lower high.
  • The indicator does not generate buy or sell signals but instead provides contextual information that can be used alongside other trading strategies.


Use Cases
  • Trend Observation: Traders can use the histogram to observe whether momentum is strengthening or weakening over time. A shift in color can indicate a potential change in trend strength.
  • Divergence Analysis: By comparing oscillator divergence with price movement, traders can identify situations where price action may be losing momentum. Divergences do not guarantee reversals but can serve as an early warning to re-evaluate positions.
  • Momentum Tracking: The dual RSI structure allows users to monitor both short-term and long-term momentum. When both RSI components are aligned, it suggests a more stable trend, while divergence between them may indicate potential consolidation or trend shifts.
  • Supplementary Analysis: This indicator is best used as a supporting tool alongside volume-based or trend-following indicators. It helps visualize underlying price behavior but should not be used in isolation for decision-making.
  • Market Context Interpretation: The combination of adaptive bands and histogram visualization allows traders to assess how recent price action compares to historical movement, helping to place current conditions in a broader market context.


Attribution
This script is an adaptation of the open-source QQE script originally developed by Glaz. We acknowledge and appreciate the original author's work, which served as a foundation for our modifications.

Disclaimer
This indicator is intended for informational purposes only. It should not be interpreted as financial advice. Always conduct independent research and risk management before making trading decisions.

Notas de Lançamento
Appendix: ZenAlgo - Q – In-Depth Methodology and Structure

ZenAlgo - Q is designed to visualize momentum changes and divergences using two RSI calculations, dynamic bands, and a histogram. The combination of these components provides a structured way to interpret price behavior.

Understanding the Components and How They Are Calculated

Dual RSI Structure (RSI1 and RSI2)
RSI (Relative Strength Index) is a momentum indicator that compares recent price movements to determine whether an asset is strengthening or weakening. Instead of using just one RSI, this script calculates two RSI values:
  • RSI1 (Main RSI for Momentum Analysis): Calculated using a 6-period RSI, smoothed with an Exponential Moving Average (EMA). This creates a more stable RSI curve that reduces short-term noise while maintaining responsiveness.
  • RSI2 (Alternative RSI for Trend Confirmation): Also based on a 6-period RSI but with a different smoothing method and threshold adjustment. It helps compare how short-term movements align with longer-term momentum shifts.


How They Work Together:
  • RSI1 represents short-term momentum, while RSI2 provides a secondary layer of confirmation.
  • If RSI1 and RSI2 move together, momentum is strong. If they diverge, it could indicate an upcoming change in trend.


QQE-Based Adaptive Bands
This script applies a Quantitative Qualitative Estimation (QQE) method to RSI1 to smooth out volatility and create adaptive trend bands.
  • Instead of using fixed overbought (70) and oversold (30) levels, the bands are calculated dynamically based on the ATR (Average True Range) of RSI fluctuations.
  • These bands help define a "normal" range for RSI movements, expanding and contracting based on price volatility.
  • When RSI moves outside of these bands, it suggests a strong shift in momentum, either bullish or bearish.


How to Interpret the Bands:
  • If RSI1 stays within the bands, momentum is stable.
  • If RSI1 breaks above the upper band, it suggests increased bullish momentum.
  • If RSI1 breaks below the lower band, bearish momentum is strengthening.


Histogram Representation of Momentum
The indicator plots two histograms (one for RSI1 and one for RSI2) to visually represent momentum strength and direction.
The histogram bars oscillate around zero, similar to MACD histograms.

Bar Color:
  • Blue (bullish): Indicates RSI1 is positive and momentum is increasing.
  • Purple (bearish): Indicates RSI1 is negative and momentum is decreasing.


Bar Height:
  • Taller bars: stronger momentum.
  • Shorter bars: weaker momentum.


How to Interpret the Histogram:
  • If bars shift from purple to blue, it suggests a potential bullish trend forming.
  • If bars shift from blue to purple, bearish momentum may be increasing.
  • A shrinking histogram suggests momentum is weakening—price may consolidate or reverse.


Divergence Identification and How It Works
Divergence occurs when price action moves in one direction while momentum (RSI) moves in the opposite direction. This can indicate a potential trend shift.

Regular and Hidden Divergences
Regular Divergence (Possible Reversal)
  • Bullish Regular Divergence: Price makes a lower low, but RSI makes a higher low.
  • Bearish Regular Divergence: Price makes a higher high, but RSI makes a lower high.
  • This suggests momentum does not support the current price trend, meaning a reversal may happen.


Hidden Divergence (Trend Continuation Signal)
  • Bullish Hidden Divergence: Price makes a higher low, while RSI makes a lower low.
  • Bearish Hidden Divergence: Price makes a lower high, while RSI makes a higher high.
  • This suggests momentum supports the trend, and the price is likely to continue moving in the same direction.


How to Interpret Divergences on the Chart:
  • Regular divergences are plotted below/above price candles and marked with "R".
  • Hidden divergences appear with an "H" and are plotted in the same way.
  • If a divergence appears with a strong histogram move, it adds confidence to the interpretation.


Additional Components for Context

Short-Term EMA Filtering (EMA-13 and EMA-21)
  • Two moving averages (EMA-13 and EMA-21) are applied to the price to help gauge short-term trend direction.
  • If price is above both EMAs, the trend is bullish. If below, the trend is bearish.
  • These EMAs provide an additional filter to validate momentum readings from RSI and the histogram.


100-Period EMA of RSI1
  • A long-term 100-period EMA is applied to RSI1.
  • This acts as a baseline to compare momentum shifts over time.
  • If RSI1 is above this EMA, the broader trend is bullish; if below, it is bearish.


How to Use It:
  • When RSI1 crosses above the 100-EMA, it may indicate long-term momentum improvement.
  • When RSI1 crosses below the 100-EMA, it may indicate a longer-term weakening trend.


Visual Markers and Interpretation

Bullish and Bearish Dots
  • Small blue/purple dots are plotted on the histogram to mark momentum confirmations.
  • These dots appear when RSI1 shows a sustained move in one direction.


Red and Green Dots for RSI Transitions
  • Red Dot: RSI1 crosses below its smoothed value while above 50.
  • Green Dot: RSI1 crosses above its smoothed value while below 50.
  • These dots help visualize key RSI shifts relative to neutral conditions.


Diamond Markers for RSI and EMA Interactions
  • A blue diamond appears when RSI1 crosses above its 100-period EMA.
  • A purple diamond appears when RSI1 crosses below its 100-period EMA.
  • These diamonds help highlight longer-term momentum shifts.


How All Components Work Together
  • The RSI structure provides momentum readings, smoothed with adaptive bands.
  • The histogram visually represents momentum strength and changes.
  • Divergence detection highlights potential shifts in trend direction.
  • EMA layers provide additional context for price movement.
  • Markers (dots & diamonds) help track momentum transitions.


This structured approach allows users to visually interpret price trends, momentum, and potential reversals without needing to manually calculate RSI shifts.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.