Williams %R
All functions · nseries package
WilliamsR
func (s Series) WilliamsR(h, l, c Series, n int) Series
WilliamsR calculates the Williams %R values over an n-period term. The output is on a -100 to 0 scale, -100*(HH - c)/(HH - LL) over the last n bars. The warm-up reads 0, not NaN: bars 0 to n-2 are exactly +0, the first valid index is n-1 and the minimum length is n, and n > len(s) gives all 0. On this scale 0 is the overbought extreme, the close at the highest high, so an overbought rule such as > -20 fires on every warm-up bar; trim (Window(-(n-1))) or mask (SetN(n-1, math.NaN())) the warm-up first. A flat window (HH == LL) gives -0, which compares equal to 0. This was reviewed in GLE-254 (3 October 2026): documentation only, no code change. Mismatched input lengths return a zero-filled series of the receiver’s length.