Skip to content
All library documents

Adding Frequency-Controlled Alerts to Technical Indicators

Article MQL5 articles

Summary

This tutorial shows how to add visual or audio alerts to MetaTrader indicators. It illustrates alert conditions for crossings between indicator lines, crossings of fixed levels, reversals in indicator movement, changes in an indicator’s position relative to price, and newly appearing markers. Examples use indicators including MACD, Stochastic, Accelerator Oscillator, and Fractals, with alert messages that identify the symbol and timeframe.

To reduce repeated notifications, the article recommends evaluating completed bars, remembering the last alert direction, and optionally limiting alerts to one per bar or alternating buy and sell alerts. It describes terminal messages, log output, alert windows, and custom sound files. The examples are implementation guidance rather than a test of signal quality: alerts only report conditions selected by the user, and they do not establish that those conditions predict profitable trades. Some indicator markers may also require waiting for later bars before they are confirmed.

Key ideas

  • Indicator alerts can be triggered by line crossings, level crossings, reversals, price-relative changes, or plotted markers.
  • Alerts can appear as terminal messages, log entries, alert windows, or custom sounds.
  • Checking completed bars helps avoid repeated or unstable alerts during an unfinished bar.
  • Tracking the previous signal direction can suppress consecutive alerts in the same direction.
  • Alert logic communicates indicator events but does not validate their trading value.

Tags

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