Forex - indicator ZZ - version zigzag retarded rate is calculated as the ratio of the volatility of the bars.
In the code, there are three options for [the two commented out] - HL all the bars, the mean arithmetic and quadratic between HL and all the latest sBars bars. If you want to invent a:)
Big options are described in the code, just in case duplicate.
extern double extHL = 5 / / coefficient for the average HL, defining the path at points where the peak is considered to be established
extern int extFlat = 48 / / number of bars fleta when the peak draw force
extern int sBars = 480; // show bars extern int sBars = 480; / / show bars