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

    Function volumeOscillator

    • Volume Oscillator — the spread between a fast and a slow moving average of volume, as a percent of the slow one:

      volOsc = 100 · (MA(volume, fastPeriod) − MA(volume, slowPeriod))
      / MA(volume, slowPeriod)

      Volume's own trend, made comparable: positive means recent activity is running above its baseline (a move with participation behind it), negative that it is drying up. Because it is a percent it reads the same on a stock trading thousands of shares and one trading millions. Appends one column.

      The formula above is priceOscillator's 'percent' mode (TA-Lib's PPO shape) with column: 'volume', so this study calls it rather than restating the arithmetic:

      volumeOscillator(bars, { fastPeriod: 5, slowPeriod: 10 })
      // ≡ priceOscillator(bars, {
      // column: 'volume', mode: 'percent', maType: 'sma',
      // fastPeriod: 5, slowPeriod: 10, output: 'volOsc',
      // })

      A test pins that identity, so the two can never drift. What the wrapper adds is the name and the defaults, and those are the whole point: the corpus lists the Volume Oscillator as its own study with a 5 / 10 SMA pair, against the Price Oscillator's 12 / 26 EMA pair — a caller reaching for "the volume oscillator" and getting priceOscillator's defaults over volume would get a differently-named indicator. Step 0 of the studies README asks whether a formula is already shipped; when it is, and only the vocabulary is new, a thin alias is the honest answer — not a second implementation, and not a silence that leaves the study undiscoverable.

      The 'absolute' mode is deliberately not re-exposed: a difference of two volume averages is a share count, which is what the percent form exists to normalise away. A caller who wants it has priceOscillator({ column: 'volume', mode: 'absolute' }).

      TA-Lib has no volume oscillator, so the oracle is a pandas replication at {5, 10, sma} and {4, 12, ema} — cases that pin what the delegation cannot be checked for by priceOscillator's own cases: that this study reads the volume column and applies these defaults.

      Inherited from priceOscillator, and identical to them:

      • Warm-up is the slow average's, per the chosen maType's table on movingAverageValues; length-preserving.
      • A zero slow average — a whole window of zero-volume bars — reports undefined, not Infinity and not 0. Untraded bars are the one realistic way to reach a zero denominator anywhere in this package.
      • An interior gap costs whatever the maType costs; window types recover once it leaves the window.
      • Invariant under scaling volume (both averages scale together) and completely independent of price — it never reads one. Pinned by property tests.
      • fastPeriod must be shorter than slowPeriod (throws).

      Type Parameters

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

      Parameters

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