Modified Momentum QQE-ZigZag [Non Repaint During Candle Building]
Jan 25, 2022

The Modified Momentum QQE-ZigZag [Non Repaint During Candle Building] tool identifies pivot points and market structure trends by combining a non-repainting QQE mechanism with ZigZag logic. It is specifically engineered to ensure that signals do not vanish or flicker during the candle-building process, providing stable real-time pivot detection and trend visualization.
Usage
The Usage section focuses on interpreting the visual cues and market structure identified by the script.
- ZigZag Pivot Points: The indicator plots lines connecting High and Low pivots. Green lines indicate bullish continuation (Higher Highs/Higher Lows), while Red lines indicate bearish continuation (Lower Lows/Lower Highs).
- Divergence Detection: The script identifies discrepancies between price action and the internal MTF RSI.
- Positive Divergence (Yellow Labels): Occurs when price makes a lower low but the RSI makes a higher low.
- Negative Divergence (Purple Labels): Occurs when price makes a higher high but the RSI makes a lower high.
- Supertrend Integration: Users can enable a modified Supertrend overlay that can optionally incorporate ZigZag pivot data into its calculation to filter out noise and identify broader trend shifts.
Details
The script addresses the common "repainting" issue found in many momentum-based ZigZag indicators. While many indicators appear stable on historical data, they often flicker (signal appears and disappears) while the current candle is still open.
This implementation achieves real-time stability by:
- Using a modified QQE (Quantitative Qualitative Estimation) calculation that utilizes the
HighandLowvalues as sources for the RSI, rather than just theClose. - Ensuring that once a crossover or crossunder occurs within the candle, the state is held to prevent the signal from disappearing before the candle closes.
- Implementing a Multi-Timeframe (MTF) RSI smoothing technique (Cutlers or Wilders) to provide a more robust momentum baseline.
Settings
ZigZag
- Rsi-Type: Choose between Cutlers and Wilders RSI calculation methods.
- Rsi-Len: Sets the base length for the RSI calculation.
- Mtf-Mult: A multiplier for the RSI length to simulate higher timeframe resolutions.
- QQE-Mult: Adjusts the distance between the QQE line and the RSI, functioning similarly to a Supertrend multiplier.
- Smooth: Applies an EMA smoothing to the RSI input.
Divergence / Convergence
- Div-Src: Select the source used for divergence calculations.
- PPs-Back: Determines how many pivot points back the script looks to identify divergences.
- Limits: Adjustable thresholds for Divergence (Top/Bot) and Convergence (Top/Bot) to filter signals based on RSI extremes.
Supertrend
- Show-Supertrend: Toggles the visibility of the Supertrend ribbon.
- Ma-Len / Ma-Type: Controls the length and type (SMA, EMA, HH/LL) of the moving average used as the Supertrend base.
- Include-ZigZag: When enabled, the Supertrend calculation incorporates ZigZag pivot data for trend detection.
FAQ
How do I access Modified Momentum QQE-ZigZag [Non Repaint During Candle Building]?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why does the indicator look different on historical data vs. real-time?
The calculation uses specific price extremes (High/Low) to ensure non-repainting in real-time. Because the exact timing of these extremes within a single historical bar cannot always be determined, real-time testing is recommended for the most accurate performance evaluation.
Can this be used for automated backtesting?
Due to the logic required to prevent real-time repainting, standard TradingView backtesting on historical candles may not perfectly reflect the real-time execution. It is best used for discretionary trading or real-time forward testing.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.