New AI Backtesting Assistant Launch!

Delta ZigZag

Mar 19, 2024

Static chart image
Dynamic Overlays
Volume Based
Works on the Following Platforms
tradingviewSymbolTradingView
For free use on the TradingView platform
ninjatraderNinjaTrader
For free use on the NinjaTrader platform
metatrader4MetaTrader 4
For free use on the MetaTrader 4 platform
metatrader5MetaTrader 5
For free use on the MetaTrader 5 platform
thinkorswimThinkorswim
For free use on the Thinkorswim platform

The Delta ZigZag indicator is focused on volume analysis during the development of ZigZag lines. Volume data can be retrieved from a Lower timeframe (LTF) or real-time Tick data.

Our Delta ZigZag publication can be helpful in detecting indications of a trend reversal or potential weakening/strengthening of the trend.

This indicator by its very nature backpaints, meaning that the displayed components are offset in the past.

USAGE

indicator image

The ZigZag line is formed by connecting Swings, which can be set by adjusting the Left and Right settings.

  • Left is the number of bars for evaluation at the left of the evaluated point.
  • Right is the number of bars for evaluation at the right of the evaluated point.

A valid Swing is a value higher or lower than the bars at the left/right.

A higher Left or Right set number will generally create broader ZigZag (ZZ) lines, while the drawing of the ZZ line will be delayed (especially when Right is set higher). On the other hand, when Right is set at 0, ZZ line are drawn quickly. However, this results in a hyperactive switching of the ZZ direction.

To ensure maximum visibility of values, we recommend using "Bars" from the "Bar's style" menu.

Volume examination

The script provides two options for Volume examination:

  • Examination per ZigZag line
  • Examination per bar

Bullish Volume is volume associated with a green bar (close > open) Bearish Volume is volume associated with a red bar (close < open) Neutral Volume (volume on a "close == open" bar) is not included in this publication.

Examination per ZigZag line

As long as the price moves in the same direction, the present ZZ line will continue. When the direction of the price changes, the bull/bear volume of the previous ZZ line is evaluated and drawn on the chart.

  • The ZZ line is divided into two parts: a bullish green line and a bearish red line.
  • The intercept of these two lines will depend on the ratio of bullish/bearish volume
  • This ratio is displayed at the intercept as % bullish volume (Settings -> Show % Bullish Volume)

** Note that we cannot draw between 2 bars. Therefore, if a ZZ line is only 1 bar long, the intercept will be at one of those 2 bars and not in between. The percentage can be helpful in interpreting bull/bear volume.*

indicator image

In the example above (2 most right labels), you can see that an overlap of 2 labels is prevented, ensuring the ability to evaluate the bullish % volume of the ZZ line.

The percentage will be colored green when more than 50%, red otherwise. The color will fade when the direction is contradictory; for example, 40% when the ZZ line goes up or 70% when the ZZ line falls.

More details can be visualized by enabling "Show" and choosing 1 of 3 options:

  • Average Volume Delta/bar
  • Average Volume/bar
  • Normalised Volume Delta

For both 'averages', the sum of "Volume"/"Volume Delta" of every bar on the ZZ line is divided by the number of bars (per ZZ line).

The "Normalised Volume Delta" is calculated by dividing the sum of "Delta Volume" by the sum of "Volume" (neutral volume not included), which is displayed as a percentage.

All three options will display a label at the last point of the ZZ line and be coloured similarly: green when the ratio bullish/bearish volume of the ZZ line is bullish and red otherwise. Here, the colour also fades when it is bullish, but the ZZ line falls or when it is bearish with a rising ZZ line.

A tooltip at each label hints at the chosen option.

indicator image

You can pick one of the options or combine them together.

indicator image

indicator image

Examination per bar

Besides information about what's happening during the ZZ line, information per bar can be visualized by enabling "Show Details" in Settings.

indicator image

  • Split Volume per bar: show the sum of bullish (upV) and bearish (dnV) volume per bar
  • Volume (bar): Total Volume per bar (bullish + bearish volume, neutral volume not included)
  • Δ Volume (bar): Show Delta Volume (bullish - bearish volume)

Using Lower Timeframe Data

indicator image

The ZigZag lines using LTF data are colored brighter. Also note the vertical line where the LTF data starts and the gap between ZZ lines with LTF data and without.

When "LTF" is chosen for the "Data from:" option in Settings, data is retrieved from Lower Timeframe bars (default 1 minute). When the LTF setting is higher than the current chart timeframe, the LTF period will automatically be adjusted to the current timeframe to prevent errors.

indicator image

As there is a 100K limit to the number of LTF intrabars that can be analyzed by a script, this implies the higher the difference between LTF and current TF; the fewer ZZ lines will be seen.

Using real-time tick data

indicator image

The principles are mostly the same as those of LTF data. However, in contrast with LTF data, where you already have LTF ZZ lines when loading the script, real-time tick data-based ZZ lines will only start after loading the chart.

indicator image

Changing the settings of a ticker will reset everything. However, returning to the same settings/ticker would show the cached data again.

indicator image

Here, you can see that changing settings reset everything, but returning after 2 minutes to the initial settings shows the cached data. Don't expect it to be cached for hours or days, though.

DETAILS

The timeframe used for LTF data should always be the same or lower than the current TF; otherwise, an error occurs. This snippet prevents the error and adjusts the LTF to the current TF when LTF is too high:

res  = input.timeframe('1')
res := timeframe.from_seconds(  math.min( timeframe.in_seconds(timeframe.period), timeframe.in_seconds(res) )  )

SETTINGS

  • Data from: LTF (Lower TimeFrame) or Ticks (Real-time ticks)
  • Res: Lower TimeFrame (only applicable when choosing LTF)
  • Option: choose "high/low" or "close" for Swing detection

ZigZag

  • Left: Lookback period for Swings
  • Right: Confirmation period after potential Swing

ZigZag Delta

  • Show % Bullish Volume*: % bullish volume against total volume during the ZZ line

  • Show:

  • Average Volume Delta/bar

  • Average Volume/bar

  • Normalised Volume Delta

See USAGE for more information

Bar Data

  • Split Volume per bar: shows the sum of bullish (upV) and bearish (dnV) volume per bar
  • Volume (bar): Total Volume per bar (bullish + bearish volume, neutral volume not included)
  • Δ Volume (bar): Show Volume Delta (bullish - bearish volume)

Trading is risky and many will lose money in connection with trading activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other markets involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools for charting platforms, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content or tool we provide.

Charts used on this site are by TradingView in which the majority of our tools are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com. TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2025 LuxAlgo Global, LLC.