Skip to content
All library documents

A Four-Cycle Expert Advisor with Equity Basket Exits

Article MQL5 code base

Summary

The document outlines an Expert Advisor organized into four independent trading cycles. Cycle 1 combines moving-average conditions with RSI and Williams’ Percent Range signals, using a register to reject conflicting indications and a one-trade-per-bar check. The other cycles apply Envelopes in trend-following, mean-reversion, and distance-filtered breakout modes. The descriptions of these three cycles are brief and do not specify their exact entry rules.

For exits, the system tracks floating profit or loss, swaps, and commissions by cycle and trade direction. It records account equity when a cycle opens its first position, then closes the matching basket when its profit target or risk limit is reached. This replaces ordinary per-position stop-loss and take-profit orders. The document also mentions cycle-specific lot sizing, but ends before explaining its formula. It gives no performance results or detailed risk thresholds, so it is an architectural overview rather than a complete strategy specification.

Key ideas

  • The Expert Advisor separates its logic into four cycles with independent identifiers and money management.
  • Cycle 1 uses moving-average conditions and other indicators to filter conflicting signals.
  • The Envelopes cycles are described as trend-following, mean-reversion, and distance-filtered breakout approaches.
  • Basket exits are based on account-equity benchmarks and cycle-specific floating profit or loss.
  • The lot-sizing routine is named but its calculation details are not provided.

Tags

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