Fast Fractal ZigZag
The ZigZag indicator is useful in tasks requiring separation of price movements into separate impulse components. Such tasks usually arise in trading systems using:
- classic patterns of technical analysis (flags, pennants, Head and Shoulder, double and triple tops, etc.);
- the golden ratio and the Fibonacci numbers;
- harmonic patterns (butterfly, shark, bat, ABCD, etc.);
- Stochastic and econometric models (ARIMA, GARCH, etc).
All these trading systems, one way or another, require determining the length of the price impulse. This is a simple task for the human eye, but it is difficult to formalize for the purposes of automatic trading. There are many various methods for determining the zigzag peaks (reversal points), each with its own drawbacks.
To determine the reversal points, the Fast Fractal ZigZag indicator uses the fractal - a model proposed by Bill Williams in the book "Trading Chaos." Fractal is a simple and logical model for determining a top or a bottom.
The main advantage of the Fast Fractal ZigZag indicator is the operation speed.
The indicator was originally designed for use in Expert Advisors, therefore, its algorithm has been optimized for fast operation in the strategy tester. The indicator does not recalculate all bars of a pattern at each price tick, but only when necessary. It usually processes one or two adjacent bars.
According to Bill Williams' definition, a fractal is the center of a series of five bars. Typical algorithm of a fractals indicator compares High and Low of 5 bars - 8 comparison operations.
The definition of a fractal as a center of seven bars will require an increase in the number of comparison operations to 12. Minor time losses, that are not noticeable during recalculation of ticks in real time, may turn into substantial delays in the process of optimization in the strategy tester.
Fast Fractal ZigZag performs only the really necessary comparison operations. If it is sufficient to perform only two comparisons (High and Low of adjacent bars) on a given tick, it will make only two.
As a result, speed of operation in the strategy tester is significantly increased.
The Fast Fractal ZigZag indicator allows adjusting the number of candles before and after a fractal. The standard definition by Bill Williams suggests two (two before and two after) candles. However, you can experiment with any number of candles.
Finally, the Fast Fractal ZigZag indicator correctly processes the external bars (candles, where a fractal was formed both on top and on bottom), therefore, the series will not contain broken impulses, one-candle impulses or two consequent impulses in the same direction.