Building MQL5 Wizard Signal Modules with Moving Average Crossings
Summary
This article explains how to create a custom trading-signal class for MetaTrader 5’s MQL5 Wizard. It outlines the CExpert architecture and the roles of its signal, money-management, trailing, trade, indicator, and account-related components. The signal class supplies methods for initialization, parameter validation, indicator setup, and checking entries, exits, reversals, and pending-order adjustments.
The implementation example uses price crossing a moving average to generate signals, with configurable parameters and protective-order levels. The article describes how to override the relevant methods, register indicators, and make the class available to the Wizard by placing it in the expected library location and restarting MetaEditor. Strategy Tester optimization is suggested for selecting parameter values. The document is a software-development guide, not evidence that the example strategy is profitable: it provides no performance results, and any tested outcome would depend on the instrument, timeframe, and testing assumptions.
Key ideas
- MQL5 Wizard expert advisors combine signal, money-management, and trailing classes with trading and market-information components.
- A custom signal class overrides methods for setup and whichever entry, exit, reversal, or order-adjustment signals it needs.
- Indicator and timeseries objects should be initialized through the Standard Library and added to the expert’s indicator collection.
- The example uses price crossing a moving average to define trading signals and protective levels.
- The Wizard can use a custom signal module after it is added to the expected library location and MetaEditor is restarted.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.