Main difference between this script and the earlier Multi Pattern is the calculation logic of 2, 3 and 4
In the earlier script, all zigzags were plain and were calculated on the basis of different lengths. (Such as 5, 10, 15, 20). These were derived on the basis of Multi Zigzag indicator
In this script, 2, 3 and 4 are calculated in slightly different way. They are calculated on the basis of previous . This means, 1 will be the input for Zigzag2 calculation and 2 will be the input for Zigzag3 and so on. This is demonstrated in the script - Multi Level Zigzag
One important parameter which is specific to this script is: UseZigZagChain
- Zigzag2 is formed based on Zigzag1
- Zigzag3 is formed based on Zigzag2
- Zigzag4 is formed based on Zigzag3
This can lead to patterns covering huge number of candles as this chaining causes exponential effect in each levels. (Effective length grows exponentially in each level)
- Zigzag2 is formed based on Zigzag1 (Same as when checked)
- Zigzag3 is formed based on Zigzag1. But, length is set to zigzag2Length + zigzag3Length
- Zigzag4 is formed based on Zigzag1. But, length is set to zigzag2Length + zigzag3Length + zigzag4Length
This reduces exponential increase of lengths over next levels.
Logical ratios of patterns are coded as below:
- Lines XABCD forms the pattern in all cases. (OXABCD in case of )
- abc = BC retacement of AB, xab = AB retracement of XA and so on
- Price difference between AB and CD are equal
- Time difference between AB and CD are equal
- Last two High Lows make W shape
- Last Low is higher than previous Last Low.
- Last High is lower than previous last High.
- Price has not gone below Last Low
- Price breaks out of last High to complete W shape
Join tradingview: https://www.tradingview.com/gopro/?share_your_love=sudh
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.