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

    Function qstick

    • QStick (Tushar Chande) — a moving average of the candle body:

      qstick = MA(close − open, period)
      

      Appends one column. It is the candlestick chart's colour, quantified: a positive reading means the last period bars closed above their opens on average (white/hollow candles dominating), negative the reverse, and the zero line is the crossover everyone reads it for. Chande's own default is an 8-bar simple average, which is what ships.

      There is only one, and it is short — the only free choices are the smoothing length and type, both options here. No TA-Lib function exists, so the oracle is a pandas replication ((close − open).rolling(n).mean() for the default, the corresponding recursion for the other types) with the analytic first valid bar asserted, not a vendor cross-check.

      maType is the shared MaType menu — ChartIQ exposes an MA-type input on this study, and the menu is the package's one answer to that (movingAverageValues), never a private smoother.

      QStick is the package's first study to read open, so open joins high / low / close / volume as a column a study names by option with a DEFAULT_OHLCV default (the atr precedent). close − open is the whole derivation, and both sides are redirectable — pointing close at a study's output and open at the raw open gives "how far the smoothed close sits above the open", which is a different (and unnamed) study, so the flexibility is deliberate rather than incidental.

      • In the units of the price, not a percent or an oscillator: a body of 0.5 on a $10 stock and on a $1000 stock read the same. It is a linear quantity — scaling every bar scales it — so it is not comparable across instruments at different price levels. Chande's own reading is relative to its own recent range.
      • The body is a derived array, so the MA runs through the K2 engine's array door, where a window type — sma included — emits only once the last period rows are all finite. First value at bar period − 1 for the window types on gap-free input; the composed types (dema, hull, …) land later, per movingAverageValues.
      • A bar missing either open or close has no body, and the gap then follows the chosen maType's interior-gap rule: window types blank the windows containing it and recover, the ema family skips it, smma and kama propagate to the end.
      • No division, so no zero-denominator case: a doji (close === open) contributes an honest 0, not a gap.

      Type Parameters

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

      Parameters

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