Skip to content
All library documents

Designing Multi-Strategy Expert Advisors for Trading Contest Rules

Article MQL5 articles

Summary

This article describes an Expert Advisor built for the constraints of the 2008 Automated Trading Championship. It combines three strategy slots, each with its own parameters, while using paired long and short entry logic and shared identifiers so that each strategy can maintain only one position at a time. Entry signals use changes in moving-average direction, with different indicator settings separating the strategies. The article treats signal generation as a simple example and concentrates on correct interaction with the trade server.

The implementation discussion covers timeframe checks, position and pending-order limits, order sizing, stop and target settings, and safeguards around closing, modifying, or deleting trades. It highlights issues such as insufficient free margin for pending orders, frozen positions, scalping-range restrictions, and pauses after trade errors. These controls aim to reduce operational failures under contest rules. The article does not report strategy returns or establish that the moving-average entries are effective; its value is chiefly in execution handling and EA structure. It also notes that high CPU use may arise from inefficient indicators called by the EA.

Key ideas

  • The EA organizes three strategy slots while respecting a limit on simultaneous positions and pending orders.
  • Each slot uses separate moving-average parameters for long and short entry signals.
  • Trade-management routines account for broker constraints, error pauses, frozen positions, and scalping-range limits.
  • Pending-order sizing needs extra care because available margin may change before an order triggers.
  • The article focuses on operational safeguards rather than evidence that its entry signals are profitable.

Tags

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