All indicators

Divergence Backtester - V2

Nov 4, 2022

Static chart image
Price Action BasedDynamic OverlaysSignalsForecastingOscillatorsDashboardDivergencesPatternsPivot Based (Retrospective)

The Divergence Backtester - V2 indicator is a comprehensive tool designed to analyze and gather statistical data on the impact of price-oscillator divergences over short-term periods. By evaluating the relationship between the last two pivot states, it provides traders with a data-driven approach to estimating future pivot formations and trend exhaustion.

Usage

The script identifies pivots and compares price action with a selected oscillator to detect divergences. It utilizes a Zigzag-based structure to visualize market swings and project potential reversal points. Traders can use the statistical tables generated by the script to understand the historical probability of price movements following specific divergence patterns.

The tool provides insights into:

  • Pivot Projections: Estimating the likely behavior of unconfirmed pivots based on historical data.
  • Trend Sentiment: Identifying visual cues (symbols and labels) that categorize the current trend as continuing, exhausting, or diverging.
  • Backtesting Stats: Analyzing "Pivot High" and "Pivot Low" projections to gauge the reliability of specific price/oscillator configurations.

Details

The script leverages a sophisticated multidimensional analysis of price and oscillator trends. It integrates various oscillators (RSI, CCI, CMO, COG, MFI, ROC) to identify discrepancies between price highs/lows and oscillator momentum. Unlike standard divergence tools, Version 2 focuses on the interaction between consecutive pivot states, allowing for a "bigger picture" estimation of market structure. It calculates sentiment based on the alignment (or lack thereof) between price direction, oscillator direction, and the overarching Zigzag trend.

Settings

  • Zigzag Length: Determines the sensitivity of the pivot detection. A higher value identifies more significant swings, while a lower value captures minor price fluctuations.
  • Oscillator Type: Allows selection from several oscillators (CCI, CMO, COG, MFI, ROC, RSI) to be used for divergence calculation.
  • Oscillator Length: Sets the lookback period for the chosen oscillator.
  • History (Supertrend Length): Controls the lookback period for calculating the internal trend status used in sentiment analysis.
  • Draw Zigzag Supertrend: Toggles the visibility of the trend-based Zigzag lines on the chart.
  • Text Size: Adjusts the size of the labels and symbols displayed on the chart.

FAQ

How do I interpret the symbols on the chart? The symbols represent trend sentiment: arrows indicate strong continuation or direction, while specific icons like "C" (Continuation) or "D" (Divergence) provide context on the current structural state.

Can I change the oscillator used for backtesting? Yes, you can switch between RSI, MFI, CCI, and other popular oscillators in the script settings to see which yields the most reliable results for your timeframe.

How do I access Divergence Backtester - V2? 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.