Skip to content
All library documents

A Fast and Slow Moving Average Crossover Signal for Expert Advisors

Article MQL5 code base

Summary

This short note describes a basic trading signal module for MetaTrader's Expert Advisor Wizard. It uses a fast moving average and a slow moving average: their crossover determines the signal direction, with the module's direction function returning a positive value for a buy direction and a negative value for a sell direction. The timeframe is configurable as an input, and the note explains where the module must be stored for the wizard to recognize it.

The document provides no crossover parameters, market or instrument guidance, entry and exit rules beyond direction, stop logic, backtest, or performance evidence. It therefore explains how to expose a simple moving-average direction signal in the platform, rather than establishing that the signal is profitable. Traders would need to define the averages and risk controls, then test the module under realistic costs and market conditions before using it.

Key ideas

  • A fast moving average crossing a slow moving average sets the signal direction.
  • The module exposes a direction function for use in the Expert Advisor Wizard.
  • The timeframe is supplied as a configurable input.
  • The note provides no parameter choices, risk rules, or evidence of trading performance.

Tags

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