The upward ZigZag segment starts when bullish (rising) patterns for High and Low has appeaed on the current bar. The same is for the downward ZigZag segments. The ZigZag line (ZigZagLineBuffer) is plotted starting from the beginning of the segment up to begining of the opposite segment.
The number under the bar indicates the pattern index (P0..P4) of the "Low bars a-la Clyde Lee". The number above the bar (P5..P9) indicates the index of the a-la Clyde Lee High bars.
The indicator doesn't repaint.
I think that this ZigZag can be used to convert the chart into the segments for further analysis.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/279
The Expert Advisor uses the Moving Average and Stochastic indicators.Hash functions library
The library contains the following hash functions: adler32, CRC-32, MaHash8v64. Also it has functions for radix conversion of a number.
Nonparametric zigzag. The monotonicity condition for the ascending segment of the zigzag: the High of the any subsequent bar should not be lower than any Low of the ascending segment.Multicurrency OnTick (string symbol) event handler
This is the simplified implementation of multicurrency mode in MetaTrader 5. It isn't necessary to consider the details how does it work. It has minimum settings and simple structure. It can be used in Strategy Tester.