Williams %R: Formula, TradingView Settings, and Testable Signals
Williams %R measures where the current close lies within a recent high-low range. Values near zero place the close near the range high; values near −100 place it near the range low. Those positions do not by themselves predict a reversal.
Formula and reference levels
Williams %R = −100 × (highest high − close) / (highest high − lowest low), using the same lookback window for both extremes. The standard length is 14 bars, with reference levels at −20 and −80. TradingView's Williams %R documentation explains the construction.
A zero high-low range makes the raw formula undefined; inspect the implementation's missing-value handling rather than assigning that condition an ordinary signal. On an open bar, both the close and the range can change.
−50 means the close is halfway between the selected extremes. It is not proof that the market has no trend. Likewise, an “overbought” reading describes a close near the upper part of the range, not a fundamental valuation judgment or evidence that the rise was unusually fast.
Add it to a chart
TradingView offers Williams %R in its indicator search. In Pineify's registered WPR configuration, the calculation input is length, defaulting to 14; drawing controls include line styling and band color. The registered configuration does not expose arbitrary threshold inputs as described in the previous version of this page.
Generate and inspect the output if you use Pineify. If a strategy needs different thresholds, define those conditions explicitly in the relevant builder or code rather than assuming the plotted band controls change the calculation.
Define the signal before testing
A candidate long rule might require a completed-bar cross back above −80. A candidate short rule might require a completed-bar cross below −20. These are hypotheses, not tested recommendations. Specify exits and execution timing separately.
Divergence requires a rule for selecting and confirming swings. A later-confirmed pivot cannot justify an order on the earlier pivot bar. There is no evidence here that weekly divergence universally outperforms daily divergence or that %R always responds faster than RSI under different settings.
Compare settings without selecting only winners
Shorter lookbacks change the range more readily; longer lookbacks retain older extremes. Start from 14 and record each alternative before evaluation. There is no established best table assigning a profitable setting to every scalping, swing, or position-trading style.
Use a separate evaluation period, include fees and realistic fills, and report trade count alongside win rate and drawdown. Profit factor is gross profit divided by the magnitude of gross loss; above one indicates a positive gross balance for that sample, not proven future profitability. Fees and other cost accounting still matter.
The previous TSLA 18%, MSFT 7%, and ES 47% win-rate/1.35 profit-factor/14% drawdown claims lack a reproducible test record. They are withdrawn. A credible test should include its exact script, parameters, data period, symbol, session, and costs before any performance conclusion is made.


