Skip to content

momentum indicator

Williams %R backtesting — Williams %R

Williams %R is a momentum oscillator that measures where the current close sits within its recent high-low range, plotted on an inverted scale from 0 to -100. It is mathematically close to the Stochastic Oscillator’s %K line, just rescaled and flipped — the practical question is still whether its overbought/oversold readings translate into an edge once tested.

Try Williams %R on BTC/USDT ETH/USDT SOL/USDT

How Williams %R works

Williams %R takes the highest high and lowest low over a lookback window, then measures how far the current close sits below the highest high as a percentage of the full range — expressed as a negative number, so 0 means the close is at the recent high and -100 means it is at the recent low. Unlike the Stochastic Oscillator, it uses no smoothing by default, so it tends to react a bit more sharply. CandleTest computes Williams %R with TradingView-parity math. Traders read above -20 as overbought and below -80 as oversold — both testable as no-code rules.

Williams %R settings

Lengthdefault 14

The lookback window for the high-low range. Shorter lengths make %R swing to its extremes more often; longer lengths produce a smoother, slower-moving line.

Example Williams %R strategies to backtest

Oversold long

Enter long when %R crosses above -80 (leaving oversold). Exit when %R crosses above -20.

Overbought exit

Exit an open long when %R crosses below -20 (leaving overbought) — signaling the recent strength has faded.

Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.

Williams %R FAQ

How is Williams %R different from Stochastic?

They measure the same underlying thing — where the close sits in its recent range — but Williams %R is unsmoothed and plotted on an inverted 0 to -100 scale, while Stochastic typically applies smoothing and includes a separate %D signal line. Because of the smoothing difference, backtested results between the two can diverge even on the same market.

Is -80/-20 the right threshold for crypto?

Those are conventional reference levels, not guaranteed thresholds — crypto’s volatility means a pair can sit near an extreme for long stretches during a strong trend. Backtest the specific levels against your market before relying on the defaults.

Does Williams %R work well without smoothing?

The lack of smoothing makes it react quickly, which can mean earlier signals but also more noise than a smoothed oscillator like Stochastic. Whether that trade-off pays off depends on the market and exit rule — worth testing both styles directly.

Is CandleTest’s Williams %R the same as TradingView’s?

Yes — the range calculation and scale follow TradingView conventions and are unit-tested for parity against known values.

Related indicators