OPEN-SOURCE SCRIPT

Dual Zigzag [Trendoscope®]

🎲 Dual Zigzag indicator is built on recursive zigzag algorithm. It is very similar to other zigzag indicators published by us and other authors. However, the key point here is, the indicator draws zigzag on both price and any other plot based indicator on separate layouts.

Before we get into the indicator, here are some brief descriptions of the underlying concepts and key terminologies

🎯 Zigzag
Zigzag indicator breaks down price or any input series into a series of Pivot Highs and Pivot Lows alternating between each other. Zigzags though shows pivot high and lows, should not be used for buying at low and selling at high. The main application of zigzag indicator is for the visualisation of market structure and this can be used as basic building block for any pattern recognition algorithms.

🎯 Recursive Zigzag Algorithm
Recursive zigzag algorithm builds zigzag on multiple levels and each level of zigzag is based on the previous level pivots. The level zero zigzag is built on price. However, for level 1, instead of price level 0 zigzag pivots are used. Similarly for level 2, level 1 zigzag pivots are used as base.

🎲 Components Dual Zigzag Indicator

Here are the components of Dual zigzag indicator
  • Built in Oscillator - Indicator has built in oscillator options for plotting RSI (Relative Strength Index), MFI (Money Flow Index), cci (Commodity Channel Index) , CMO (Chande Momentum Oscillator), COG (Center of Gravity), and ROC (Rate of Change). Apart from the given built in oscillators, users can also use a custom external output as base. The oscillators are not printed on the price pane. But, printed on a separate indicator overlay.
  • Zigzag On Oscillator - Recursive zigzag is calculated and printed on the oscillator series. Each pivot high and pivot low also prints a label having the retracement ratios, and price levels at those points. Zigzag on the oscillator is also printed on the indicator overlay pane.
  • Zigzag on Price - Recursive zigzag calculated based on price and printed on the price pane. This is made possible by using force_overlay option present in the drawing objects. At each zigzag pivot levels, the label having price retracement ratios, and oscillator values are printed.


It is called dual zigzag because, the indicator calculates the zigzag on both price and oscillator series of values and prints them separately on different panes on the chart.

🎲 Indicator Settings
Settings include
  • Theme display settings to get the right colour combination to match the background.
  • Zigzag settings to be used for zigzag calculation and display
  • Oscillator settings to chose the oscillator to be used as base for 2nd zigzag


스냅샷

🎲 Applications
  • Useful in spotting divergences with both indicator and price having their own zigzag to highlight pivots
  • Spotting patterns in indicators/oscillators and correlate them with the patterns on price



🎲 Using External Input
If users want to use an external indicator such as OBV instead of the built in oscillators, then can do so by using the custom option.

Here is how this can be done.

Step1. Add both Dual Zigzag and the intended indicator (in this case OBV) on the chart. Notice that both OBV and Dual zigzag appear on different panes.
스냅샷

Step2. Edit the indicator settings of Dual zigzag and set custom indicator by selecting "custom" as oscillator name and then by setting the custom external indicator name and input.
스냅샷

Step 3. You would notice that the zigzag in Dual Zigzag indictor pane is already showing the zigzag pivots based on the OBV indicator and the price pivots display obv values at the pivot points. We can leave this as is.
스냅샷

Step 4. As an additional step, you can also merge the OBV pane and the Dual zigzag indicator pane into one by going into OBV settings and moving the indicator to above pane. Merge the scales so that there is no two scales on the same pane and the entire scale appear on the right.
스냅샷

At the end, you should see two panes - one with price and other with OBV and both having their zigzag plotted.

스냅샷
Chart patternshewhomustnotbenamedtrendoscopeZig Zag Indicator

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항