StatZigZag indicator

<p>Description and work algorithm . &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The StatZigZag indicator looks like a regular ZigZag , but is built on the basis of completely different algorithms. The StatZigZag indicator is a broken line built from segments of regression lines of different lengths, the beginning of each of which comes from the end of the previous segment. Each regression segment is built until the variance or spread of price around it begins to exceed a certain critical value, after which the construction of this segment ends and the construction of the next segment begins. This approach is due to the following. The variance of the price around the regression segment begins to grow strongly with large price jumps and with an increase in its volatility, which take place when the trend movement changes. This allows the broken line resulting from the operation of this algorithm to track the trend and the moments of its reversals . &nbsp;&n</p>