Momentum OscillatorsPine Script v6

ta.wpr()Williams %R

Williams %R is a momentum indicator that measures overbought and oversold levels on a scale from -100 to 0.

TradingView language reference

Syntax

Syntax
ta.wpr(length) → series float

Arguments

ParameterTypeDescription
lengthseries intLookback length for the highest high and lowest low.

Returns

Williams %R.

Remarks

na values in the source series are ignored.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.wpr")
plot(ta.wpr(14))

Trading Applications

Identify overbought (above -20) and oversold (below -80) conditions

Define and test extreme-level conditions without assuming reversal

Confirm trend strength with sustained readings

Compare divergences without treating them as reversal timing

Related Functions

Frequently Asked Questions

ta.wpr(length) returns Williams %R using the chart high/low/close over the lookback window, scaled from -100 (weak) toward 0 (strong within the range).

Common conventions use −20 and −80. Readings can remain extreme during a trend; these labels do not establish mispricing or a reversal.

With the same high, low, close and length and a nonzero range, Williams %R equals raw stochastic %K minus 100. Both increase as close moves toward the range high; %R is shifted, not directionally inverted.

Generate ta.wpr() Code with AI

Draft Pine Script using ta.wpr() with Pineify's AI Coding Agent, then review the arguments and test the result on your chart. Usage depends on your plan and available credits.