On Balance Volume Indicator: Formula, Settings and How to Read It

On Balance Volume, published by Joseph Granville in 1963, adds a bar's entire volume to a running total when the close rises and subtracts it when the close falls. An unchanged close leaves the total exactly where it is.

Senzoukria · Indicators · Updated September 2026


On Balance Volume ships with the Senzoukria desktop app, in the Volume group of the indicator catalogue. It is drawn in its own panel below the chart.

What On Balance Volume measures

Direction is decided by strict comparison of consecutive closes: greater adds, lower subtracts, equal does nothing, so doji bars are never counted as bullish. Every bar's volume is signed in full — the indicator draws no distinction between a close one tick higher and one thirty ticks higher. Senzoukria seeds the series at 0 on the first bar loaded, which makes the plotted line reproducible while leaving its absolute level meaningless. The cumulation is continuous and is not reset at the 17:00 CT open, an anchor reserved for session-based measures such as cumulative delta.

The formula, as implemented

This is not a description of how the indicator is usually defined elsewhere — it is what the shipped code computes, documented next to the implementation:

Période entière ≥ `min` depuis les params (garde-fou UI). */ function intParam( params: Record<string, unknown>, key: string, fallback: number, min = 1, ): number { return Math.max(min, Math.floor(numParam(params, key, fallback))); } function toPoints( bars: readonly FootprintBar[], values: ReadonlyArray<number | null>, ): SeriesPoint[] { return bars.map((b, i) => ({ time: b.bucketTsNs, value: values[i] ?? null })); } /** Points d'histogramme : `f` rend `null` quand la barre n'a pas d'information — la barre n'émet alors PAS de point (contrat `HistogramPoint` : pas de trou, pas de valeur inventée). */ function histPoints( bars: readonly FootprintBar[], f: (bar: FootprintBar, i: number) => number | null, ): HistogramPoint[] { const out: HistogramPoint[] = []; for (let i = 0; i < bars.length; i++) { const v = f(bars[i], i); if (v !== null) out.push({ time: bars[i].bucketTsNs, value: v }); } return out; } function histOut( points: HistogramPoint[], positiveColor: string, negativeColor: string, ): SeriesOutput { return { shape: "histogram", points, positiveColor, negativeColor }; } /** SMA N sur série à trous : null dès qu'UNE valeur de la fenêtre est null — moyenner autour d'un trou mentirait sur la période effective (même règle que `smaNullable` de momentum.ts). */ function smaNullable( values: ReadonlyArray<number | null>, period: number, ): Array<number | null> { const n = Math.max(1, Math.floor(period)); const out: Array<number | null> = new Array<number | null>(values.length).fill(null); for (let i = n - 1; i < values.length; i++) { let sum = 0; let ok = true; for (let j = i - n + 1; j <= i; j++) { const v = values[j]; if (v === null) { ok = false; break; } sum += v; } if (ok) out[i] = sum / n; } return out; } /** EMA N par segment de valeurs définies consécutives. Un trou reste null et réinitialise uniquement la graine suivante : les valeurs antérieures sont conservées. Chaque reprise attend N valeurs pour sa SMA initiale, puis suit la même récurrence que `emaSeries`, sans zéro synthétique. */ function segmentedEma( values: ReadonlyArray<number | null>, period: number, ): Array<number | null> { const n = Math.max(1, Math.floor(period)); const alpha = 2 / (n + 1); const out: Array<number | null> = new Array<number | null>(values.length).fill(null); let count = 0; let sum = 0; let ema = 0; for (let i = 0; i < values.length; i++) { const v = values[i]; if (v === null) { count = 0; sum = 0; continue; } if (count < n) { sum += v; count += 1; if (count < n) continue; ema = sum / n; } else { ema += alpha * (v - ema); } out[i] = ema; } return out; } /** Money Flow Volume de Chaikin pour UNE barre : MFM = ((close − low) − (high − close)) / (high − low) ∈ [−1, +1] MFV = MFM × volume MFM est la position du close dans le range, recentrée : +1 = close au plus haut (toute la barre a été achetée), −1 = close au plus bas. Range NUL (high = low) → `null` : le multiplicateur est un 0/0, la barre ne porte aucune information directionnelle. Les appelants décident quoi en faire — cumul → contribution 0 (cf. en-tête), non cumulé → pas de point. / function moneyFlowVolume(bar: FootprintBar): number | null { const range = bar.high - bar.low; if (!(range > 0)) return null; const mfm = (bar.close - bar.low - (bar.high - bar.close)) / range; return mfm * bar.totalVolume; } /** Ligne A/D (Chaikin) : cumul du Money Flow Volume depuis la première barre chargée. Barre à range nul → contribution 0 (exception documentée en en-tête : un accumulateur ne peut pas porter de trou). CONTINU — pas de reset session (l'A/D est une ligne d'accumulation de long terme). */ function accumDistValues(bars: readonly FootprintBar[]): number[] { const out: number[] = new Array<number>(bars.length); let running = 0; for (let i = 0; i < bars.length; i++) { running += moneyFlowVolume(bars[i]) ?? 0; out[i] = running; } return out; } /** VWMA N sur une fenêtre glissante : Σ(close·volume) / Σ(volume). Σvolume = 0 sur la fenêtre (barres placeholder sans trade) → null : 0/0 n'est pas « 0 ». Warm-up (< N barres) → null. Même formule que `vwma` (averages2.ts) — redéclarée ici plutôt que d'élargir la surface publique d'un autre fichier de famille (sa primitive n'est pas exportée). */ function vwmaSeries( bars: readonly FootprintBar[], period: number, ): Array<number | null> { const n = Math.max(1, Math.floor(period)); const out: Array<number | null> = new Array<number | null>(bars.length).fill(null); let sumPV = 0; let sumV = 0; for (let i = 0; i < bars.length; i++) { sumPV += bars[i].close * bars[i].totalVolume; sumV += bars[i].totalVolume; if (i >= n) { sumPV -= bars[i - n].close * bars[i - n].totalVolume; sumV -= bars[i - n].totalVolume; } if (i >= n - 1) out[i] = sumV > 0 ? sumPV / sumV : null; } return out; } /** Indices de volume de Fosback/Dysart (NVI / PVI) — même moteur, deux déclencheurs : index[0] = base index[i] = index[i−1] × (1 + (close[i] − close[i−1]) / close[i−1]) si `trigger(volume[i], volume[i−1])`, sinon index[i−1] NVI : trigger = volume EN BAISSE (Fosback — l'« argent malin » se positionne les jours calmes). PVI : trigger = volume EN HAUSSE (la foule). Volume ÉGAL → aucun des deux ne bouge (inégalités STRICTES, convention d'origine : une journée sans changement de participation n'est ni l'un ni l'autre). close[i−1] = 0 → contribution 0, l'indice est GELÉ (exception documentée en en-tête : le ratio n'existe pas, et un null perdrait l'ancrage de toute la suite de l'indice — un indice base 1000 sans ancrage ne vaut rien). / function volumeIndexValues( bars: readonly FootprintBar[], base: number, trigger: (vol: number, prevVol: number) => boolean, ): number[] { const out: number[] = new Array<number>(bars.length); let idx = base; for (let i = 0; i < bars.length; i++) { if (i > 0) { const prev = bars[i - 1]; const prevClose = prev.close; if (trigger(bars[i].totalVolume, prev.totalVolume) && prevClose !== 0) { idx *= 1 + (bars[i].close - prevClose) / prevClose; } } out[i] = idx; } return out; } // ── Defs ──────────────────────────────────────────────────────────────────── /** OBV — On Balance Volume (Granville, 1963) : OBV[0] = 0 (graine, cf. convention) OBV[i] = OBV[i−1] + volume[i] si close[i] > close[i−1] = OBV[i−1] − volume[i] si close[i] < close[i−1] = OBV[i−1] si close[i] = close[i−1] POURQUOI : la thèse de Granville est que le volume précède le prix. L'OBV signe le volume ENTIER de la barre par la direction du close — sa PENTE et ses divergences avec le prix sont l'information, jamais son niveau absolu. Convention GRAINE : OBV[0] = 0. L'indicateur n'a pas d'origine absolue (Granville lui-même part d'un nombre arbitraire) ; ancrer à 0 sur la première barre CHARGÉE rend la série reproductible et lisible. Corollaire assumé : charger plus d'historique décale toute la courbe — c'est vrai de tout OBV, ATAS et TradingView compris. Convention ÉGALITÉ : close inchangé → OBV inchangé (règle de Granville, inégalités STRICTES — pas de « ≥ » qui compterait les dojis comme haussiers). CONTINU : pas de reset de session — l'ancrage 17:00 CT ne concerne que les cumuls orderflow type CVD, l'OBV est une accumulation de long terme.

How to read it

  • Granville's claim was that volume precedes price; whatever you make of that, the usable content is the slope of the line and its disagreements with price, never its level.
  • A series of higher OBV lows under flat price means down-closes arrived on lighter volume than up-closes across that stretch.
  • When price makes a new high and OBV does not, the up-closes behind that high carried less volume than earlier ones — a fact about those bars, not a signal.
  • Since loading more history moves the whole curve, build nothing on an OBV threshold; build on shape.
  • On intraday futures, compare OBV with cumulative delta: OBV signs volume by close direction, delta signs it by aggressor, and they disagree exactly where absorption occurred.

Parameters and defaults

Smoothing defaults to 1, leaving the raw cumulative line untouched; values up to 200 apply a post-smoothing pass that makes the long-horizon slope easier to see while hiding the individual bars that produced it. Blue (#2962ff) is the default colour.

On Balance Volume — parameters exposed in the app, with the values it ships with.
ParameterTypeDefaultRange
Smoothingnumber11 – 200

What it does not show

OBV is all-or-nothing: a one-tick advance and a large one contribute identically, which makes the line jumpy on instruments that often close near unchanged. It uses the close only, so everything that happened inside the bar stays invisible, including absorption and the aggressor side. The zero seed makes absolute values meaningless and incomparable across charts or history depths — a property shared by every OBV implementation, including those in ATAS and TradingView. Equal closes freeze the line, so heavily rounded or low-resolution price data flattens it for mechanical reasons.

Using it in Senzoukria

Add it from the Indicators panel of any footprint chart or candle chart. It runs on futures data from Rithmic or Databento and on crypto pairs from Binance and Bybit, on the same engine — the calculation does not change with the venue, only the data feeding it does. Market data subscriptions are billed by the provider, separately from the app.

See the full indicator library, or start with the order flow guide if you are new to reading aggression, delta and absorption.

Frequently asked questions

How is On Balance Volume calculated?
Starting from a seed value, each bar's full volume is added when its close is above the previous close and subtracted when it is below. When the two closes are equal the total is unchanged. In Senzoukria the seed is 0 on the first bar loaded in the chart.
Does On Balance Volume reset at the session open?
No. OBV runs continuously across sessions, since Granville designed it as a long-horizon accumulation. The 17:00 CT session anchor in the application applies to session-based cumulations such as cumulative delta or session volume, not to OBV.
What is the difference between OBV and cumulative delta?
OBV signs a bar's volume by the direction of its close, so it depends only on OHLC data. Cumulative delta signs volume by the aggressor side of each trade and requires bid/ask classification from the feed. They diverge where aggressive volume did not move the close, which is the signature of absorption.

Keep reading