Momentum-based ZigZag (incl. QQE) NON-REPAINTING
Sep 8, 2021

The Momentum-based ZigZag indicator identifies price pivot points and structural trends by leveraging momentum oscillators rather than traditional time-based or fixed-percentage rules, ensuring a non-repainting output for real-time analysis.
Usage
The Usage section focuses on identifying market reversals through momentum shifts. Unlike standard ZigZag tools that wait for a specific number of candles to confirm a pivot—often resulting in lag or excessive noise during choppy markets—this tool plots a pivot point the moment a chosen momentum indicator reverses.
Momentum Selection
Users can choose between three different momentum engines to drive the ZigZag logic:
- MACD: Uses crossovers between the MACD line and the Signal line to define trend changes.
- Moving Average: Identifies shifts based on the directional change (slope) of a selected moving average type.
- QQE (Quantitative Qualitative Estimation): A sophisticated RSI-based oscillator that filters market noise to provide reliable trend signals.
Force Detection
The script includes a "force" detection mechanism using a fast RSI (length 5). If a price impulse reaches overbought or oversold territories during a move, the ZigZag line can be colored to indicate strength. This helps traders distinguish between a healthy trend and a weakening impulse likely to reverse.
Details
The script is designed to be strictly non-repainting. While traditional ZigZag indicators frequently redraw previous lines as new price extremes are reached, this tool prints the pivot point only when the momentum confirmation is finalized. This results in a "stair-step" visual style where lines are confirmed and locked in real-time.
The logic operates by tracking the highest high or lowest low during a momentum phase. When the momentum indicator switches direction (e.g., MACD cross-under), the script identifies the extreme point of the previous phase and anchors the ZigZag line to that coordinate.
Settings
- Color ZigZag lines to show force direction: Enables dynamic coloring of the ZigZag based on RSI-driven impulse strength.
- Select Momentum Indicator: Toggles between MACD, Moving Average, or QQE as the primary trend engine.
if MACD Selected
- Fast/Slow Length: Controls the periods for the MACD calculation.
- Signal Smoothing: Adjusts the period of the signal line.
- Oscillator/Signal MA Type: Allows selection between SMA or EMA for the MACD components.
if Moving Average selected
- Average Type: Choose from SMA, EMA, WMA, VWMA, HMA, RMA, or DEMA.
- Length: Sets the lookback period for the moving average slope detection.
if QQE selected
- RSI Length: The lookback period for the internal RSI.
- QQE Factor: A multiplier that affects the sensitivity of the QQE bands.
- RSI Smoothing: The smoothing factor applied to the RSI.
TP
- Take Profit Level: Defines the target level used in the automated alert messages.
FAQ
How does this differ from the standard ZigZag indicator?
Standard ZigZags use price-action thresholds or candle counts to confirm pivots, which can lead to repainting. This tool uses momentum oscillators to confirm reversals, ensuring that once a point is plotted, it remains fixed.
Does this indicator provide trading signals?
Yes, the script generates "LONG" and "SHORT" labels at the pivot points based on momentum shifts and includes logic for Stop Loss and Take Profit levels.
How do I access the Momentum-based ZigZag?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.