Skip to content
All library documents

Zero-Lag ZigZag Stochastic with Price Divergence Signals

Article ProRealCode

Summary

This custom oscillator combines ZigZag-based price bounds with a stochastic-style calculation. It smooths the resulting value to form a zero-lag line and a slower signal line, then compares oscillator turning points with recent price extremes to mark potential bearish and bullish divergences. The indicator plots the oscillator, signal line, a midpoint, and colored segments for detected divergence candidates.

The code specifies lookback and smoothing settings, but the document gives no chart examples, backtest, or performance results. Divergence detection depends on recent extrema and ZigZag turning points, which can change as later prices arrive; the material does not discuss signal confirmation, trading rules, or risk controls. It is therefore an indicator construction example rather than evidence of a profitable strategy.

Key ideas

  • The indicator derives a stochastic-style value from ZigZag highs and lows over a rolling period.
  • It smooths the oscillator and produces a second line as a signal reference.
  • Bearish divergence candidates compare a lower oscillator peak with a higher price high.
  • Bullish divergence candidates compare a higher oscillator trough with a lower price low.
  • The document supplies code but no backtest or evidence of trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.