All indicators

Divergence for Many Indicators v4

Dec 25, 2020

Static chart image
Volume BasedSignalsOscillatorsDivergencesMoving Averages

The Divergence for Many Indicators v4 indicator scans and identifies regular and hidden divergences between price and multiple user-selectable technical indicators. It provides a modular framework for detecting trend reversals and continuations across various momentum and volume oscillators simultaneously.

Usage

The Usage section describes how the script can be used to identify market shifts. The tool monitors the relationship between price action and selected oscillators, marking points where they decouple.

  • Indicator Selection: Users can toggle 10 built-in indicators including RSI, MACD (Main and Histogram), Stochastic, CCI, Momentum, OBV, VWMACD, CMF, and MFI.
  • External Input: By enabling "Check External Indicator," you can link the script to any other indicator currently loaded on your chart to scan for divergences on that specific source.
  • Divergence Types:
    • Regular Positive/Negative: Used to spot potential trend reversals.
    • Hidden Positive/Negative: Used to spot potential trend continuations.
  • Filtering: The "Minimum Number of Divergence" setting allows you to filter for signals where multiple indicators agree, increasing the confluence of the alert.
  • Visual Management: Users can choose to show indicator names (Full or Initials), display the count of active divergences, or show only the most recent signal to keep the chart clean.

Details

The script executes by checking for divergences between the current candle and the last 16 Pivot Points (within a 100-bar lookback window) for every enabled indicator.

  • Confirmation Logic: By default, the script waits for price and indicator movement to confirm the divergence. For positive divergences, it verifies if the closing price and indicator value are higher than the previous value before plotting. This can be bypassed using the "Don't Wait for Confirmation" setting for more aggressive entries.
  • Geometric Validation: The script doesn't just look at peaks; it calculates the slope between pivot points and ensures that intervening price action or indicator values do not breach the "virtual line" connecting those peaks, ensuring the validity of the divergence.
  • Pivot Point Source: Users can switch between "Close" and "High/Low" for pivot detection. Using "High/Low" is often preferred for traditional technical analysis, while "Close" can filter out "wick noise" in volatile markets.

Settings

General Settings

  • Pivot Period: Determines the number of bars required on each side of a high/low to qualify as a pivot point.
  • Source for Pivot Points: Choose between "Close" or "High/Low" prices for calculation.
  • Divergence Type: Select between "Regular", "Hidden", or "Regular/Hidden".
  • Show Indicator Names: Controls how indicator labels appear (Full, First Letter, or None).
  • Minimum Number of Divergence: Sets the threshold for how many indicators must show divergence simultaneously to trigger a label.
  • Maximum Pivot Points to Check: Limits how many historical pivots the script scans (1–20).
  • Maximum Bars to Check: Limits the historical lookback for divergence scanning (30–200).
  • Don't Wait for Confirmation: If enabled, the script plots signals as soon as the price/indicator geometry aligns without waiting for a reversal tick.

Indicators

  • Indicator Toggles: Individual checkboxes for MACD, RSI, Stochastic, CCI, MOM, OBV, VWMACD, CMF, and MFI.
  • Check External Indicator: Enables scanning of an external source.
  • External Indicator: The data source input used when the external check is enabled.

Aesthetics & Moving Averages

  • Colors/Styles: Customizable colors, line widths, and styles (Solid, Dashed, Dotted) for each divergence type.
  • Show MAs 50 & 200: Optional toggle to display the 50-period and 200-period Simple Moving Averages for trend context.

FAQ

How can I see which indicators are currently triggering a divergence?
Set the "Show Indicator Names" setting to "Full." When a signal appears, the labels above or below the bar will list the specific oscillators (e.g., RSI, MACD) that have formed a divergence.

Why does a divergence signal sometimes disappear or shift?
Divergence detection relies on Pivot Points, which require a "Pivot Period" (default 5 bars) to be confirmed. If "Don't Wait for Confirmation" is off, the script ensures the reversal is established before plotting.

How do I access Divergence for Many Indicators v4?
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.