Docs

ta.wpr

Read how near the close sits to the top or bottom of its range, on a -100 to 0 scale.

itm
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.

NameKindTypeUnitDefaultRangeDescription
lengthConstantnumber-141 to 10000Window in observed bars.
barsConstantbarsbarsna-Which bars to read: a declared series, or na for the chart's own.

Output

NameTypeUnit
valuenumber-

Warm-up and missing values

Warm-up
length bars. Names in the warm-up are this operator’s parameters.
Missing values
Returns na until length consecutive 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

itm
ta.wpr(14)
itm
plot(ta.wpr(14), "Range position 14")