Skip to content
All library documents

Using Nested ZigZag Swings to Generate Trading Signals

Article MQL5 code base

Summary

This Expert Advisor builds signals from two ZigZag indicators operating at different scales. It examines the two legs of the latest peak in the slower, larger ZigZag and counts the smaller ZigZag peaks inside those legs. User parameters compare the peak counts and the price difference between large-scale peaks, providing a way to classify the broader swing based on its internal structure.

The described setup uses one ZigZag with parameters 13, 5, and 3, and another with each parameter multiplied by eight. A buy signal closes open sell positions, while a sell signal closes open buy positions. The page mentions testing on EURUSD at the one-minute timeframe, but provides no test statistics or detailed performance evidence. ZigZag turning points can shift as prices evolve, and the document does not specify execution, risk controls, or enough rules to assess robustness; the method should therefore be treated as an indicator-based signal concept rather than a validated strategy.

Key ideas

  • The method compares a slower ZigZag swing with the smaller swings nested inside its legs.
  • A peak-count ratio and a ratio based on prices at larger ZigZag peaks are configurable signal inputs.
  • The example scales all three parameters of the larger ZigZag by eight relative to the smaller one.
  • New buy and sell signals close positions in the opposite direction.
  • The document mentions a EURUSD one-minute test but gives no performance metrics or risk-management details.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.