Skip to content
All library documents

Testing ZigZag Signals with Stop-Loss and Take-Profit Optimization

Article MQL5 code base

Summary

The document describes adapting an automated trading system to test signals from a ZigZag-based trend indicator. The system opens trades when signals arise and exits through stop-loss or take-profit orders; it can hold multiple orders, with the count tied to signals. The author optimizes stop-loss and take-profit settings, first across a long historical interval and then over a later subperiod, and compares results with moving-average crossover signals using similar trade counts.

The reported observations include upward equity behavior and limited drawdowns for selected configurations, alongside long flat periods and extended losing sequences in another setting. These are qualitative claims tied to the shown platform tests, not proof of robustness. The tests use control-point modeling on an M15 chart, and the author notes that the indicator can change signals before targets are reached and does not fully capture trend selectivity. Parameter optimization and the absence of independent validation leave substantial overfitting and execution uncertainty.

Key ideas

  • The system tests ZigZag indicator signals with stop-loss and take-profit exits.
  • The author optimizes the two exit distances and compares the signal with moving-average crossovers.
  • The discussion treats loss cutting and allowing gains to run as design principles.
  • Reported equity behavior varies by parameters and can include long plateaus and losing streaks.
  • The platform tests do not establish out-of-sample robustness or account for all execution risks.

Tags

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