williams_r
Williams %R momentum oscillator
williams_r(period)
Parameters
| Name | Type | Description |
|---|---|---|
period |
int | Number of periods for the high-low range |
Formula
%R = ((highest(high, period) - close) / (highest(high, period) - lowest(low, period))) * -100, or -50 when the range is zero
Examples
williams_r(14); # Standard 14-period Williams %R
williams_r(20); # 20-period Williams %R
williams_r(14) > -20; # Overbought condition
williams_r(14) < -80; # Oversold condition
Returns
float
Range
period must be 2-400
Notes
Inverted scale versus Stochastic (0 is top, -100 is bottom); returns -50 when the range is zero to avoid dividing by zero
See Also
References
TradingView: ta.wpr(); developed by Larry Williams