Skip to content
All library documents

Integrating MetaTrader Signal Modules into a Modular Strategy Engine

Article MQL5 articles

Summary

This article describes connecting MetaTrader 5’s standard signal classes to the CStrategy trading engine so that strategies can reuse existing indicator-based patterns. It surveys the library’s class structure, including signal modules, indicators, price series, trading components, and their dependencies. Because signal objects rely on initialized indicators and time series, the article emphasizes setting up the full initialization chain when building a custom expert advisor. It explains how signal modules detect buy and sell patterns, return condition strengths, and let developers enable or weight individual patterns. The MACD module serves as an example, with patterns such as line crossings, reversals, and divergence. The article also describes an adapter for using signals in the engine and combining them into a strategy; its example uses RSI conditions for entries and Accelerator Oscillator behavior for exits. A chart is presented as evidence that the example’s logic operates, but no performance statistics are provided. The contribution is a code-reuse and system-integration method, not evidence that the illustrated rules are profitable.

Key ideas

  • MetaTrader signal classes can be integrated into CStrategy to reuse standard indicator-based pattern logic.
  • Custom use requires initializing signal objects, their indicators, and the price series they depend on.
  • Signal modules provide separate long and short conditions and can assign different strengths to individual patterns.
  • An adapter can combine multiple signals, as shown by an example using RSI for entries and AC for exits.
  • The article demonstrates operation visually but provides no quantified evidence of profitability.

Tags

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