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

    Function atrBands

    • ATR Bands — a field with a volatility band either side of it:

      upper = column + multiplier × ATR(period)    ${prefix}Upper
      lower = column − multiplier × ATR(period) ${prefix}Lower

      Appends two columns, not three. There is no ${prefix}Middle: the middle is the field itself, already on the series as column — a third column would be a copy of one the caller passed in, which is a column to keep in step rather than a measurement. (Contrast keltner and bollinger, whose centres are computed — a moving average the caller does not otherwise have — and are therefore worth appending.)

      The half-width is Wilder's ATR, the same atrValues kernel call atr makes, at the same default period 14. That is the whole study: atrBands is atr() plus two additions, and ${prefix}Upper − column === multiplier × atr holds bit-for-bit, not to rounding — pinned by a test against the shipped atr study rather than asserted here. TA-Lib has no ATR-band function; the oracle is a pandas replication on the ATR reference it already cross-checks against TA-Lib, so the numbers are TA-Lib's ATR with arithmetic on top.

      column is what the bands are drawn around; high / low / close are what the ATR is computed from. They default to the same 'close', and separating them is what lets the bands sit on something the ATR is not measured from — bands around an sma, say ({ column: 'sma' }) — which is the usual reason to reach for this study rather than keltner. Redirect all four together to run the study on a second instrument's columns.

      • Both bands start at bar period, the ATR's own first bar (true range needs a previous close, so a period-bar average of it lands one bar later than a period-bar window would — the atr off-by-one). If column warms up later than that (bands around another study's output), the bands start where it does; NaN propagates through the addition with no branch.
      • In the units of the price: scaling every bar scales both bands.
      • A leading gap shifts the Wilder seed; an interior gap propagates to the end — inherent to Wilder smoothing, and the same asymmetry atr documents. A gap in column alone costs only that bar.
      • No division, so no zero-denominator case: a flat stretch gives ATR = 0 and both bands sit on the field.

      Type Parameters

      • S extends SeriesSchema
      • const Prefix extends string = "atrb"

      Parameters

      Returns TimeSeries<
          readonly [
              S[0],
              ValueColumnsForSchema<
                  readonly [
                      S[0],
                      ValueColumnsForSchema<S>,
                      OptionalNumberColumn<`${Prefix}Upper`>,
                  ],
              >,
              OptionalNumberColumn<`${Prefix}Lower`>,
          ],
      >