Williams Percent Range Alert Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The williams percent range alert indicator answers one question. Where did this bar close inside the last eighteen bars of range? At the very top the reading is zero. At the very bottom it is minus one hundred. Everything else falls between, and four alert routes report the extremes.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window
Plots 1: Williams %R
Alerts popup, push notification, email, sound
Inputs 7

Reading the drawn elements

A single plot in the pane below price.

`Williams %R` runs lime green.

The scale runs from zero down to minus one hundred.

Zero sits at the top rather than the bottom.

No second line and no arrows appear.

Nothing gets drawn on the price chart.

  • Williams %R: plot, lime green
williams percent range alert indicator: The single reading line on the EURUSD H1 chart.
The single reading line on the EURUSD H1 chart.

From bar to value

The window

One pass finds two prices. `Period` `18` bars give the highest high and the lowest low. Those two set the range the close gets measured inside.

Where the close sits

It is a share of that range. The distance from the high down to the close, over the whole range, times minus one hundred. Closing at the high gives zero.

A flat window

Sometimes the range is zero. Eighteen identical bars would divide by nothing, so the code returns minus fifty instead. That keeps the line drawn rather than broken.

How to take it

Minus twenty and above means closing near the high.

Minus eighty and below means closing near the low.

The reading pins at an extreme in a one-way move.

Minus fifty is the middle of the window.

A quick swing across the scale is common on fast charts.

The line says nothing about how far price travelled.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` covers the extreme alerts and ships true with `EnablePopup`. Turn on `EnablePushNotify` for a phone, `EnableEmail` for mail, or `EnableSound` to play `SoundFile`. Those three arrive off, and each extreme reports once a bar.

Every Williams Percent Range Alert Indicator input

Core settings

Setting What it does Default
Period Bars in the range window, `18`. 18

Alert settings

Setting What it does Default
EnableAlerts Master switch, `true`. on
EnablePopup Box in the terminal, `true`. on
EnablePushNotify Buzz on a phone, `false`. off
EnableEmail Mail at an extreme, `false`. off
EnableSound Cue at an extreme, `false`. off
SoundFile Which clip plays, `”alert.wav”`. alert.wav
williams percent range alert indicator: Inputs panel with Period and the alert routes.
Inputs panel with Period and the alert routes.

Setting it up somewhere useful

Eighteen bars is a little longer than the usual fourteen, which steadies the line. EURUSD H1 is the reference chart. It covers most of a session there. On M5 the reading crosses the scale constantly. On daily bars it tracks the last month.

What it misses

A bounded reading pins during a trend.

One outsized bar sets the range for eighteen bars.

An extreme is not a turn.

The single plot gives you nothing to cross.

Copy the compiled Williams Percent Range Alert Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Related on forexmt4systems.com: Range Trading Strategy.

Download the Williams Percent Range Alert Indicator for MT4 and MT5

The zip holds the compiled Williams Percent Range Alert Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

Why does Period 18 use eighteen bars?

It is a little longer than the common fourteen, which makes the line steadier without losing much reaction. The window sets both the highest high and the lowest low, so lengthening it widens the range every close gets measured against.

What does the Williams %R plot show at zero?

A close exactly at the highest high of the window. The scale is inverted, so zero sits at the top of the pane and minus one hundred at the bottom, which catches out anyone expecting the usual direction.

Can EnableAlerts fire on eighteen flat bars?

Only in theory. A window with no range at all would divide by zero, so the code returns minus fifty instead and the line stays continuous. On a liquid symbol that case never arises.

Does the Williams %R plot call a built-in?

No. The highest high, the lowest low and the division all run inside this source, so the whole calculation stays visible and nothing depends on a terminal call you cannot read.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Williams Percent Range Alert Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment