Skip to content
All library documents

Adding Sound, Email, and Push Alerts to a Moving Average Signal Indicator

Article MQL5 code base

Summary

This technical note explains how to add alert delivery to a MetaTrader indicator that already stores buy and sell signals in indicator buffers. It describes configurable inputs for selecting the signal bar, enabling sound, setting an alert count, and turning email or mobile push messages on or off. Separate buy and sell routines inspect the relevant buffer and assemble notifications containing signal direction, price fields, time, symbol, and chart timeframe.

The integration calls both routines after the indicator’s calculation cycle and assumes each is called only once from that section. The note also says buffer entries without signals must be represented consistently, using zero or an empty-value marker. It is implementation guidance, not evidence that the underlying moving average indicator produces profitable signals. The sample’s price and spread handling should be checked against the platform’s conventions, and the alert mechanism itself does not define signal quality, execution, or risk controls.

Key ideas

  • The indicator can expose configurable sound, email, and push notifications for buy and sell signals.
  • Separate routines read the signal buffers and format alert details for the active symbol and timeframe.
  • The routines should be called after indicator calculations and only once per calculation block.
  • Signal buffers need consistent empty-value handling so absent signals are not mistaken for valid ones.
  • Alerts report indicator events but do not establish strategy profitability or provide trade risk management.

Tags

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