Skip to content
All library documents

Adding Buy and Sell Alerts to a Williams Percent Range Indicator

Article MQL5 code base

Summary

This document describes adding notifications to a semaphore-style indicator based on Williams Percent Range signals as the oscillator leaves overbought or oversold territory. The additions let a user choose the bar used for signal checks, enable sound, email, or mobile push messages, and set an alert count. Buy and sell routines inspect the relevant indicator buffer, select the corresponding bar index based on array orientation, and assemble a message containing the signal side, time, symbol, timeframe, and price information.

The routines are called after the indicator’s calculations in its calculation handler; the document says each should be called only once there and notes that unused buffer values must be represented by zero or an empty value. It explains the integration points but offers no trading-performance evidence or evaluation of the underlying Williams %R signals. The example also derives both displayed prices from the close before adjusting one by spread, so users should check whether those values match their intended quote conventions. This is an alert implementation guide, not a tested trading strategy.

Key ideas

  • The indicator generates buy and sell signals when Williams Percent Range leaves extreme zones.
  • Alert options include sound, email, and mobile push notifications, with configurable bar selection and alert count.
  • Signal routines inspect indicator buffers while accounting for whether arrays are stored as series.
  • The routines are intended to run once each after the indicator calculation cycle.
  • The document explains notification plumbing but provides no evidence that the underlying signals are profitable.

Tags

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