All indicators

Divergence-Support/Resistence

Oct 15, 2021

Static chart image
Support and ResistanceSignalsDivergencesPivot Based (Retrospective)

The Divergence-Support/Resistence indicator identifies key price rejection levels by combining zigzag logic with divergence detection to filter significant support and resistance areas. By focusing exclusively on pivots that exhibit regular or hidden divergence, the tool helps traders filter out market noise and focus on levels where momentum shifts are likely.

Usage

This tool can be used to identify high-probability reversal or continuation zones. Unlike standard pivot indicators that mark every high and low, this script only draws levels when a divergence is confirmed between price action and an oscillator.

  • Support/Resistance Levels: Horizontal lines are extended from the point of detection. If the price is above a line, it acts as support; if below, it acts as resistance.
  • Directional Bias: Lines are color-coded based on the type of divergence (shades of green for bullish, shades of red for bearish).
  • Divergence Symbols:
    • ↗: Bullish Hidden Divergence
    • ↘: Bearish Hidden Divergence
    • ⤴: Bullish Divergence
    • ⤵: Bearish Divergence

Details

The script utilizes a zigzag-based framework to identify structural highs and lows. It then compares these peaks and troughs against a built-in oscillator (or an external source) to look for discrepancies in momentum.

A unique aspect of this implementation is that it allows for two simultaneous zigzag lengths (Zigzag 1 and Zigzag 2), enabling the tracking of both short-term and medium-term structural levels on the same chart. The oscillator periods are automatically scaled based on the zigzag length to ensure mathematical consistency without requiring manual tuning for every timeframe.

Settings

Main

  • Max Depth: Determines the maximum number of support and resistance lines to keep on the chart simultaneously.

Zigzag

  • Show Zigzag 1 / 2: Toggles the calculation and visibility of levels for two different zigzag lengths.
  • Zigzag Length 1 / 2: Sets the sensitivity for pivot detection. Higher values find more significant structural points, while lower values find more frequent, minor levels.

Oscillator

  • Oscillator Source: Choose between several internal oscillators (CCI, CMO, COG, MFI, ROC, RSI, Stoch, TSI, WPR).
  • External Source: Allows the user to link the divergence detection logic to any other indicator on the chart via the source input.

FAQ

  • How do I use this for trend continuation? Hidden divergence (↗ or ↘) typically signals trend continuation. If a level is formed with hidden divergence and the price holds that level, it reinforces the existing trend.
  • Can I change the lookback for the divergence? The lookback is dynamically linked to the "Zigzag Length." Increasing the zigzag length will naturally increase the lookback period for the divergence detection.
  • How do I access the Divergence-Support/Resistence? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.