Momentum Indicators

Williams %R Indicator: Overbought/Oversold Levels + Signals

In this page: what Williams %R is, how it works, when to use it, a practical example with code, and a bonus tip.

๐Ÿ“– 8 min read

๐Ÿ“ 1,586 words

๐Ÿท๏ธ Momentum Indicators

Williams %R on a price chart: illustration of the indicator and how it is used in technical analysis
Williams %R โ€“ chart illustration

Williams %R Indicator Explanation

The Williams %R (also known as Williams Percent Range) is a momentum oscillator that measures the position of the current closing price relative to the highest high and lowest low over a specified lookback period. Developed by Larry Williams, a renowned trader and author, in the 1970s and detailed in his book "How I Made One Million Dollars Last Year Trading Commodities" (1979), Williams %R oscillates between 0 and -100, providing traders with a normalized view of price momentum that helps identify overbought and oversold conditions. The indicator is similar to the Stochastic oscillator but uses an inverted scale, making it particularly useful for identifying potential reversal points in ranging markets.

How Williams %R Works: Williams %R is calculated using the formula: %R = [(Highest High - Close) / (Highest High - Lowest Low)] ร— (-100), where Highest High is the highest price over the lookback period (typically 14 periods), Lowest Low is the lowest price over the same period, and Close is the current closing price. The result is multiplied by -100 to create a scale from 0 to -100, where values above -20 typically indicate overbought conditions and values below -80 indicate oversold conditions. The indicator uses the highest high and lowest low over the lookback period to create a relative position measurement, allowing traders to assess whether the current price is near the top or bottom of the recent price range.

When to Use Williams %R:

  • Overbought/Oversold Identification: Williams %R is highly effective at identifying overbought conditions (values above -20) and oversold conditions (values below -80) in ranging or sideways markets, signaling potential reversal opportunities when prices reach extreme levels relative to recent trading ranges.
  • Momentum Confirmation: The indicator helps confirm momentum strength when used in conjunction with trend indicators. In uptrends, Williams %R staying above -50 indicates strong upward momentum, while in downtrends, values staying below -50 indicate strong downward momentum.
  • Entry and Exit Timing: Williams %R provides clear entry signals when it moves from overbought territory (above -20) back into neutral territory, or from oversold territory (below -80) back into neutral territory, indicating potential momentum reversals and entry opportunities.

Advantages:

  • Provides clear, objective signals for overbought and oversold conditions with well-defined thresholds (-20 for overbought, -80 for oversold), making it easy to identify potential entry and exit points without subjective interpretation. The inverted scale helps traders quickly assess price position relative to recent ranges.
  • Works effectively across multiple timeframes and asset classes, including stocks, forex, commodities, and cryptocurrencies, as momentum measurement is universal. The indicator is particularly useful in ranging markets where price oscillates within defined ranges.
  • Helps reduce false signals when combined with trend indicators, as Williams %R overbought/oversold conditions are more reliable when confirmed by price action and trend direction. The indicator's sensitivity to price extremes makes it valuable for mean-reversion strategies.

Limitations:

  • Williams %R can remain in overbought or oversold territory for extended periods during strong trends, leading to premature exit signals if used in isolation without trend confirmation. The indicator may give false signals in trending markets where prices continue to move in one direction.
  • False signals can occur in ranging markets when Williams %R oscillates between -20 and -80 without clear directional bias, requiring additional confirmation from other indicators or price action analysis. The indicator's sensitivity to price extremes can result in frequent signals during volatile periods.
  • The default 14-period setting may not be optimal for all markets and timeframes, requiring parameter optimization based on market characteristics and trading style. Shorter periods increase sensitivity but may produce more false signals, while longer periods reduce sensitivity but may miss trading opportunities.

In summary, Williams %R is a valuable momentum indicator for traders seeking to identify overbought and oversold conditions and potential reversal points, particularly in ranging markets. For comprehensive understanding, refer to Williams' original work "How I Made One Million Dollars Last Year Trading Commodities" (1979) (opens in a new tab), Investopedia's Williams %R guide (opens in a new tab), TradingView's Williams %R documentation (opens in a new tab), and academic research on momentum oscillators in technical analysis published in journals such as the Journal of Financial Markets and the Review of Financial Studies.

Practical Example: Using the Williams %R Indicator in a Trading Strategy

The Williams %R (Williams Percent Range) is a momentum oscillator used to identify overbought and oversold conditions by measuring the position of the current closing price relative to the highest high and lowest low over a specified period. In a trading strategy, the Williams %R indicator helps traders make entry and exit decisions based on momentum extremes and potential reversal signals.

Scenario: You're creating a mean-reversion strategy for EUR/USD on a 1-hour chart. You want to buy when the currency pair is oversold (Williams %R below -80) and sell when it's overbought (Williams %R above -20), assuming prices will revert to the mean after reaching extreme momentum levels in a ranging market.

Strategy Logic:

  • Calculate the Williams %R(14) to measure current momentum conditions relative to the recent price range. The indicator oscillates between 0 and -100, where values below -80 indicate oversold conditions and values above -20 indicate overbought conditions.
  • Buy signal: When Williams %R crosses below -80 (oversold condition) and then crosses back above -80, indicating potential upward momentum reversal and entry opportunity.
  • Sell signal: When Williams %R crosses above -20 (overbought condition) and then crosses back below -20, indicating potential downward momentum reversal and exit opportunity.

Backtrader Example:

python
import backtrader as bt

class WilliamsRMeanReversionStrategy(bt.Strategy):
    params = dict(
        williams_period=14,
        oversold_level=-80,
        overbought_level=-20
    )
    
    def __init__(self):
        self.williams_r = bt.ind.WilliamsR(period=self.p.williams_period)
        
    def next(self):
        if not self.position:
            # Buy when Williams %R crosses back above oversold level (-80)
            if (self.williams_r[0] > self.p.oversold_level and 
                self.williams_r[-1] <= self.p.oversold_level):
                self.buy()
        else:
            # Sell when Williams %R crosses back below overbought level (-20)
            if (self.williams_r[0] < self.p.overbought_level and 
                self.williams_r[-1] >= self.p.overbought_level):
                self.sell()

# Usage
cerebro = bt.Cerebro()
cerebro.addstrategy(WilliamsRMeanReversionStrategy)

Expected Outcome: By using the Williams %R indicator, your strategy identifies momentum extremes and potential reversal points, helping you enter trades when prices are likely to revert to the mean after reaching extreme levels. This approach leads to better entry timing, reduced false breakout entries, and improved risk-reward ratios in ranging markets where price oscillates within defined ranges.

๐Ÿ’ก Bonus Tip

Consider using Williams %R divergence as a confirmation signal. When price makes a new low but Williams %R makes a higher low, it suggests weakening downward momentum and potential bullish reversal. This technique, documented in Williams' original methodology, can significantly improve the accuracy of Williams %R-based trading strategies by identifying momentum shifts before price reversals occur.

Using the Williams %R indicator ensures your strategy captures momentum shifts effectively, improving entry and exit timing based on objective momentum measurements relative to recent price ranges.

The scale runs negative

Williams %R measures where the current close sits inside the recent high-to-low range. Its scale is the thing to get right before anything else:

%R runs from โˆ’100 to 0. Not 0 to 100.

A reading of โˆ’100 means the close is at the very bottom of the lookback range; 0 means it is at the very top. Every other bounded oscillator most people have met โ€” RSI, stochastic โ€” runs 0 to 100, which is exactly why this one causes a specific and silent failure.

The condition that is always true

Write the oversold threshold the way you would for RSI and you get this:

pine
// WRONG โ€” every %R value is at or below 0, so this is true on every bar
oversold = wprValue < 20
pine
// Correct โ€” the oversold end of the %R scale is near -80
oversold = wprValue < -80
overbought = wprValue > -20

The broken version does not error, does not warn, and does not look broken. It produces a strategy that enters on every bar until pyramiding is full, reports a full trade list, and shows an equity curve. Nothing in the Strategy Tester says "your condition is a constant".

This is why the input test matters. Move the threshold from 20 to 50 to 90 and watch the trade count. If it never changes, your condition is not reading the indicator โ€” the same check that catches an unreferenced input, described in reading the Strategy Tester.

Building it in the form

FieldValueWhy
IndicatorWilliams %R
Length14the conventional lookback; nothing derives it
Oversoldโˆ’80note the minus sign
Overboughtโˆ’20
Exitopposite level, or an ATR stop%R gives no exit of its own

Then read the export and confirm the emitted comparison carries the negative sign. If the generated Pine shows a bare positive number against the %R series, the control in the settings dialog is not the number the logic uses โ€” see what each field becomes.

What %R does not tell you

The same thing no oscillator tells you: whether the move is over. %R reaching โˆ’100 means price closed at the bottom of its recent range, which in a downtrend is the normal state rather than a reversal. It can sit near โˆ’100 for dozens of bars.

So %R alone is a range tool. In a trend it needs a gate โ€” a moving-average filter or a volatility regime test โ€” and the honest way to check whether your gate does anything is to count how many trades it removes: the confluence test.