Trendoscope

Multi Level Zigzag

Trendoscope Wizard 已更新   
At first I thought of doing double zig zag. Once developed I thought it is not much effort to make it multi level zigzag. This script is not same as multi-zigzag indicator (link in the end). In multi zigzag indicator we use zigzag based on different length and each zigzag has no relation to each other. In this script however, each zigzags are related to each other. We cannot just derive Zigzag 4 without deriving Zigzag 3. (Though we can hide each of them individually)

The logic is simple.

Zigzag1: This is the basic zigzag plotted based on given length.
Zigzag2, Zigzag2, Zigzag3 : These are built based on lower level zigzags.

For example, Zigzag2 is built based on Zigzag1 pivots. For calculation, we just use N*2 number of Zigzag1 pivots to derive the next level. Similarly Zigzag2 will become input for Zigzag 3 and Zigzag3 will become input for Zigzag4

Input parameters allow you to chose upto 4 levels of zigzag along with zigzag line color and length. Max array lines also defines how many lines back you want to calculate the zigzag pivots and display then in the stats. Lowering this number will not reduce the number of lines - but, it will limit possibility of calculating higher level zigzags. Stats table just highlight which pivots are applicable for which outer level.

Application: Can be used in pattern recognization scripts to improve accuracy.

Disclaimer: This is not working in intraday charts. Nothing I could do at this point of time. Use it only for daily + timeframes.

Related scripts:




版本注释:
  • Added zigzag chain option. If chain is used, zigzags are based on previous levels. If chain is not used. All multi level zigzags are derived based on base level - Level1. But, lengths gets added up on each iteration.
  • Added waitForConfirmation flag for plotting next level pivots
版本注释:
There was a small issue in zigzag calculation where single bar presented both pivot high and low. This has been corrected.
版本注释:
Remove redundant vars
版本注释:
Major changes
  • Added option to use external source or custom source instead of regular high/low for zigzag.
  • Memory optimization by deleting old elements of array.
版本注释:
Minor corrections.
版本注释:
Convert to pine5

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?