ta.wpr
Read how near the close sits to the top or bottom of its range, on a -100 to 0 scale.
ta.wpr(length, bars)Williams %R: 100 * (close - highest(high, length)) / (highest(high, length) - lowest(low, length)), all three read from bars. The value is negative and bounded to [-100, 0]: 0 at the top of the range, -100 at the bottom. That sign is the published convention and is kept.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
length | Constant | number | - | 14 | 1 to 10000 | Window in observed bars. |
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
Warm-up and missing values
- Warm-up
lengthbars. Names in the warm-up are this operator’s parameters.- Missing values
- Returns na until
lengthconsecutive bars with a usable high and low have been observed. An na resets the accumulation. na when the window's high equals its low.
Example
ta.wpr(14)plot(ta.wpr(14), "Range position 14")