@pond-ts/financial API Reference
    Preparing search index...

    Function williamsR

    • Williams %R (Larry Williams) — how far the close sits below the highest high of the trailing period bars, as a percentage of the range, bounded −100..0:

      %R =100 · (HH − close) / (HHLL)
      

      Appends one column; undefined for the first period − 1 rows.

      TA-Lib's WILLR. Verified bar-for-bar in the oracle fixture with an identical warm-up, agreeing to 1.4e-14.

      %R is the fast stochastic %K shifted down by 100 — 100·(c−LL)/(HH−LL) − 100 rearranges to the formula above — so it is computed on the same kernel as stochastic rather than owning a second division, and a test pins the identity williamsR ≡ stochastic({ slowing: 1 }).K − 100. What differs is convention, not maths: %R is quoted negative and unsmoothed, and its "overbought" reads above −20 where %K's reads above 80.

      • A flat window (HH === LL) is undefined — the one deliberate delta from TA-Lib, which reports 0. 0 is also %R's value for "close at the very top of a real range", so TA-Lib's answer cannot distinguish the two; and the same TA-Lib convention gives %K 0 — the very bottom — for the same bar. The kernel (percentOfRangeValues) reports no value instead, for both studies.
      • Bounded −100..0 whenever low ≤ close ≤ high; redirect close at a column the range does not bound and it reads outside, unclamped.
      • Scale-invariant, like RSI; a leading gap shifts the start; an interior gap in close costs that bar only, and one in high/low is skipped by the range (core's reducer policy).

      Type Parameters

      • S extends SeriesSchema
      • const Output extends string = "williamsR"

      Parameters

      Returns TimeSeries<
          readonly [S[0], ValueColumnsForSchema<S>, OptionalNumberColumn<Output>],
      >