Williams Percent Range Indicator: Where The Close Sits

Written by Dominic Walsh · Published · Last updated

The williams percent range indicator asks a single question about each bar. How far below the recent high did it close? Larry Williams built the answer as a percentage, and it runs from zero down to minus one hundred.

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

What the Williams Percent Range Indicator draws on the chart

One gold `Williams %R` line fills the pane.

Zero means the close matched the highest high in the window.

The far end of the scale means it matched the lowest low instead.

No second line and no marks ship with this build.

  • Williams %R: plot, gold
Williams percent range indicator reading in its own pane on the EURUSD H1 chart.
Williams percent range indicator reading in its own pane on the EURUSD H1 chart.

How the Williams Percent Range Indicator calculates its values

Three prices, one ratio

The code finds the highest high and the lowest low across `Period` `12` bars. It then measures how far the close sits below that high, as a share of the whole range.

The scale runs negative

Multiplying by minus one hundred puts the result between zero and minus one hundred. That inverted scale is the convention Williams chose, and it catches people out.

A flat range writes minus fifty

When the highest high equals the lowest low, dividing would fail. The code writes the midpoint instead, which happens rarely and only on very still bars.

How to read the signals

Readings near zero mean the close is at the top of its recent range.

Readings near minus one hundred mean the opposite.

A twelve-bar window is shorter than the usual fourteen, so it reacts faster.

The reading can pin at an extreme through a strong trend.

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

`EnableAlerts` is the parent toggle and ships true with `EnablePopup`. Switch `EnablePushNotify` for a handset alert, `EnableEmail` for mail, or `EnableSound` to play `SoundFile`. Those three arrive off. Closed bars only.

Every Williams Percent Range Indicator input

Core settings

Setting What it does Default
Period Bars in the high and low window, default `12`. 12

Alert settings

Setting What it does Default
EnableAlerts Parent toggle for every reading alert, default `true`. on
EnablePopup Terminal box on a fresh reading, default `true`. on
EnablePushNotify Handset alert on a fresh reading, default `false`. off
EnableEmail Mail on a fresh reading, default `false`. off
EnableSound Sound clip on a fresh reading, default `false`. off
SoundFile Clip filename, default `”alert.wav”`. alert.wav
Williams percent range indicator inputs panel showing Period and the alert switches.
Williams percent range indicator inputs panel showing Period and the alert switches.

Settings that fit your chart

A twelve-bar window is short. EURUSD H1 is the reference chart, where it covers half a trading day. On M5 the line swings across the full scale constantly. H4 and daily give a much calmer reading.

When the Williams Percent Range Indicator fails

A bounded reading pins at an extreme during a strong move and stays there.

`Period` `12` is short, so the line is jumpy without extra smoothing.

Nothing marks a signal, so any rule has to come from you.

Copy the compiled Williams Percent Range 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 Indicator for MT4 and MT5

The zip holds the compiled Williams Percent Range 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 the Williams %R scale run negative?

Because it measures distance below the recent high rather than position above the low. Larry Williams defined it that way, and multiplying by minus one hundred is what produces the inverted scale.

What does Period 12 cover?

Twelve bars of highs and lows, which is shorter than the fourteen most builds use. That makes the line react faster and reach the extremes more often, which suits shorter timeframes.

How does Period 12 differ from a stochastic?

Very little, mathematically. Both measure where the close sits inside a recent range. The scale is inverted here and there is no signal line, but the underlying question is the same.

What happens when the Period window is flat?

The highest high equals the lowest low, so the division would fail. The code writes minus fifty, the midpoint of the scale, which is the honest answer for a bar with no range.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Williams Percent Range 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