Measuring Price Behavior with ZigZag Segment Statistics
Summary
This article develops several MQL5 indicators that extract statistics from ZigZag segments: how frequently direction changes, the sums and averages of upward and downward segments, and the percentage balance between those sums. A further indicator compares segment behavior on a higher timeframe with the formation of its segments on a lower timeframe. The article also describes expert advisors for testing these measures and collecting statistics by segment size, duration, and price range.
The proposed interpretations are exploratory. A larger sum of segments in one direction may offer clues about price behavior, while a small difference between directional percentages may indicate a flat market. The author suggests that sequences of readings may be needed to interpret such conditions. No validated performance results are provided, and the text explicitly leaves the reliability of these measures for future testing. ZigZag-derived readings should therefore be treated as descriptive features to investigate, not established predictive signals.
Key ideas
- FrequencyChangeZZ counts bars associated with the formation of alternating ZigZag segments.
- Sum and percentage indicators compare the accumulated sizes of upward and downward segments.
- A multi-timeframe indicator examines how lower-timeframe movement forms segments on a higher timeframe.
- A small difference between directional segment percentages may describe a flat condition, but the interpretation can require a sequence of readings.
- The article presents these measures for analysis and testing without establishing that they predict future prices.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.