Adding Buy and Sell Alerts to a Trading Indicator
Article MQL5 code base
Summary
The document describes how to extend a BrainTrend signal indicator so that detected buy and sell signals can trigger sound alerts, email messages, or mobile push notifications. It adds settings for selecting the bar used to check for a signal, enabling each notification channel, and limiting the number of repeated alerts. Separate routines handle buy and sell buffers, assemble a message with time, symbol, timeframe, and price information, and are called after indicator calculations.
Key ideas
- The indicator checks its buy and sell buffers at a configurable bar to detect signals.
- Sound, email, and mobile push notifications can be enabled independently.
- A counter limits repeated alerts, and the routines reset it when the calculated bar count changes.
- Alert messages include the instrument, chart timeframe, timestamp, and price fields derived from close and spread data.
- The method assumes each signal routine is called once from the indicator calculation flow and requires correctly configured buffers.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.