Skip to content

OnBalanceVolume


class backtide.indicators.OnBalanceVolume()

On-Balance Volume (OBV).

A cumulative volume indicator that adds volume on up-close days and subtracts it on down-close days. Rising OBV confirms an uptrend; falling OBV confirms a downtrend. Useful for confirming price trends with volume and spotting divergences between price and volume momentum.

Formula:

\[OBV_t = \begin{cases} OBV_{t-1} + V_t & \text{if } C_t > C_{t-1} \\ OBV_{t-1} - V_t & \text{if } C_t < C_{t-1} \\ OBV_{t-1} & \text{otherwise} \end{cases}\]

Read more on Wikipedia.

Attributes

acronym : str

Short ticker-style acronym.

name : str
Human-readable indicator name.


See Also

MovingAverageConvergenceDivergence

Moving Average Convergence Divergence (MACD).

RelativeStrengthIndex

Relative Strength Index (RSI).

VolumeWeightedAveragePrice

Volume-Weighted Average Price (VWAP).


Methods

compute Compute the indicator on a dataset.
description Short explanation of what the indicator measures.


method backtide.indicatorscompute(data)

Compute the indicator on a dataset.

Parameters

data : np.ndarray | pd.DataFrame | pl.DataFrame

Historical OHLCV data.

Returns

np.ndarray | pd.Series | pl.Series | pd.DataFrame | pl.DataFrame

The computed values. For multi-output indicators (e.g., upper and lower bounds), return a 2d structure.



method backtide.indicatorsdescription()

Short explanation of what the indicator measures.

Returns

str

The description.