This is a lagging indicator: fractals lag by one bar and can lag by many bars. However, its strength lays in objectively defining historic price action: e.g. levels and waves within a trend.
See the comments at the beginning of the script for a complete description.
Minor enhancement: Added smarts for plotting zigzag lines at dual fractal bars. Instead of always bisecting the bar, highs or lows are used depending on the trend direction.
- Add alert conditions for price crossing outer or inner range levels.
- Add user selection for 3 or 5 point fractals... and variations.
- Add user selection for "Trend Direction Method": alternating or consecutive fractal types.
- Better smarts for handling dual fractal bars.