TRADINGVIEW · PRICE DIRECTION AND CUMULATIVE VOLUME
The OBV indicator adds a bar’s volume when its close is above the previous close, subtracts volume when the close is lower, and makes no change when the closes match. On-Balance Volume produces a cumulative line. Read its direction and swing relationships against price, then check the data behind it. Its absolute value is neither a universal trading threshold nor an amount of money entering the market.
TradingView’s built-in OBV also offers optional smoothing. The Length field in that section controls an additional moving average; it does not turn raw OBV into a fourteen-bar rolling total. Changing the chart timeframe can change the cumulative calculation itself, even when the underlying trades are unchanged.
What On-Balance Volume measures
Joseph Granville introduced OBV in his 1963 book, Granville’s New Key to Stock Market Profits. Its calculation assigns a positive or negative sign to each bar’s volume using a close-to-close comparison, then carries that signed amount into the running total.
When volume assigned to rising closes outweighs volume assigned to falling closes over an interval, OBV rises over that interval. The price change’s size does not set the amount added. A one-point rise and a twenty-point rise each add the entire bar’s volume if both finish above the preceding close.
This is a deliberately simple compression of price and volume. It does not classify each transaction as buyer-initiated or seller-initiated, identify institutions, or reveal every movement inside a candle. An “accumulation” interpretation remains an interpretation of the plotted series; the formula has no field containing the identity of a buyer.
OBV also has no fixed upper or lower boundary. A large positive number can describe a weak recent move if the line has been falling from a higher value. A negative number can accompany a rising recent sequence. Compare the line with its own relevant history rather than treating zero, 100,000, or another round value as an automatic buy or sell boundary.
Apply the OBV formula to each completed bar
Let B be the previous OBV, C the current close, Cprev the previous close, and V the current bar’s volume. The three branches are:
If C > Cprev: OBV = B + V.
If C < Cprev: OBV = B − V.
If C = Cprev: OBV = B.
Compare the current close with the previous close, rather than the current open. A candle can finish above its own open while still closing below the preceding candle’s close. In that case the standard OBV calculation subtracts its volume. Candle color alone is an unreliable shortcut when the chart colors bars using open-to-close direction.
The unchanged-close branch matters too. A bar can trade substantial volume and finish at the same close as the prior bar. OBV then makes no change, which does not mean that no trading occurred. Volume is being classified by one price comparison, not reconstructed transaction by transaction.
The units follow the supplied volume series. Shares, contracts, base-currency volume, and tick counts describe different measurements. Multiplying a cumulative OBV number by the current price would not convert it into verified net cash flow.
Calculate a six-observation example
Start a reference calculation at OBV = 0 with a preceding close of 100. Then process five hypothetical bars with closes 102, 101, 103, 103, and 102. Their volumes are 1,000, 2,000, 3,000, 4,000, and 5,000. The starting row supplies a reference, rather than a claim about how a particular platform initializes its first available bar.
| Observation | Close | Volume | Signed addition | Running OBV |
|---|---|---|---|---|
| Reference | 100 | Not used | Starting value | 0 |
| 1 | 102 | 1,000 | +1,000 | 1,000 |
| 2 | 101 | 2,000 | −2,000 | −1,000 |
| 3 | 103 | 3,000 | +3,000 | 2,000 |
| 4 | 103 | 4,000 | 0 | 2,000 |
| 5 | 102 | 5,000 | −5,000 | −3,000 |
At observation 2, price remains above the reference close of 100, but that bar closes below observation 1’s 102. Its 2,000 volume is therefore subtracted. At observation 4, the close matches observation 3, so the 4,000 volume contributes zero to OBV.
Across the whole sequence, price ends at 102, above the initial 100, while OBV ends 3,000 below its starting value. The volume attached to declining closes exceeded the volume attached to advancing closes. Price’s net change and OBV’s net change answer different questions.
This constructed example demonstrates the calculation. It supplies neither a historical divergence success rate nor an executable trade. A real review still needs the selected instrument, bar interval, volume source, and a rule defining what happens after a divergence appears.
The starting value changes the scale, not later additions
Repeat the same reference calculation from 10,000 instead of zero. Every subsequent OBV value is exactly 10,000 higher. The additions and subtractions are unchanged. A chart beginning with more historical observations can therefore display a different absolute level while preserving the later changes over matching data.
The same constant shift carries through a matching simple moving average. If both raw OBV and its SMA are increased by 10,000, their difference stays unchanged. Their crossing relationship is preserved. A strategy based on a universal raw threshold such as “OBV above zero” does not have that starting-point independence.
Compare common dates and the same completed observations when reconciling two charts. An initial offset is only one possible explanation. Different timeframes, sessions, volume feeds, or closing prices can also change the later additions, in which case a constant vertical shift will not reconcile the lines.
Why a different timeframe can reverse OBV’s direction
Suppose the five hypothetical bars are consecutive one-minute bars inside one complete five-minute period. Their total volume is 15,000. The preceding five-minute close is 100 and the current five-minute close is 102.
The five-minute OBV calculation sees one rising close and adds all 15,000. The one-minute calculation sees five separate close comparisons and produces a net addition of −3,000. Both use the same five volume observations; they assign the signs at different aggregation intervals.
OBV calculated on five-minute bars is therefore not generally the same as a one-minute OBV line sampled every five minutes. Changing the timeframe changes the input sequence to the sign rule. This difference can exist before considering any separate daily-versus-intraday feed discrepancies.
Choose the timeframe that supplies the observation your method needs, then keep it fixed when evaluating signals. If you deliberately combine two timeframes, define which supplies context and which supplies an entry condition. A disagreement between the lines does not by itself establish that one feed is broken.
Set up the built-in OBV on TradingView
Open Indicators, search for OBV or On Balance Volume, and select the built-in indicator. Open its settings and select Inputs. The current settings image shows Smoothing Type = None, Length = 14, and Calculation Timeframe = Chart, with Wait for timeframe closes checked.

To add a twenty-period simple moving average of OBV, choose SMA under Smoothing Type and enter 20 in Length. That is a chosen example setting, not the screenshot’s default. Select None again to display the raw indicator without its additional moving average.
The available smoothing choices include SMA, SMA + Bollinger Bands, EMA, SMMA (RMA), WMA, and VWMA. BB StdDev applies to the SMA + Bollinger Bands choice. It does not change the basic rule assigning a bar’s volume a positive, negative, or zero contribution.
For a short arithmetic illustration, a three-observation SMA at observation 3 averages OBV values 1,000, −1,000, and 2,000, giving about 666.67. At observation 4 it is 1,000; at observation 5 it is about 333.33. Those are averages of the cumulative line, rather than signed-volume totals for only the last three bars.
Leave Timeframe at Chart when learning the current chart’s calculation. If you select a higher timeframe, Wait for timeframe closes controls whether confirmed higher-timeframe values arrive after that period completes. A line connecting confirmed points does not create additional independent readings between those points.
The TradingView indicators guide covers indicator selection and signal availability more broadly. The built-in OBV reference links to the current smoothing and calculation controls.
Read trend confirmation and divergence at matching swings
Begin with price. Mark the relevant completed swing highs or lows, then compare OBV around those same observations. Rising price highs and lows accompanied by rising OBV highs and lows describe directional confirmation. Falling structures in both series describe confirmation in the other direction.
A bearish divergence can develop when price makes a higher high while OBV fails to make a corresponding higher high. A bullish divergence can develop when price makes a lower low while OBV holds a higher low. Match the time interval and price source, rather than linking an unrelated OBV turning point to whichever wick makes the chart look convincing.
Because OBV’s sign depends on closes, inspect closing prices alongside wick extremes. State whether your own swing-selection rule uses highs, lows, or closes. The indicator’s calculation and your method for selecting comparison points are separate choices, and changing either after seeing the outcome changes the test.
Divergence supplies a condition to investigate. It does not identify the exact reversal bar or require price to turn. A strong trend can continue through repeated non-confirmations. Wait for the price event required by your method, and keep examples where that event fails to appear.
Separate a volume confirmation from an entry order
During a price range, OBV may form rising lows while price stays below resistance. That shows the signed-volume series strengthening under its chosen calculation. A later OBV resistance break and a later price resistance break are distinct events; either can happen first, and one may occur without the other.
A hypothetical breakout method could require a completed price close beyond the range and a defined OBV condition. Another could wait for a price retest. Specify the reference high, confirmation close, permitted entry time, and cancellation rule before assessing results. A historical line cannot prove that an order filled at the signal candle’s close.
If price keeps crossing the same range while OBV alternates around its average, there may be no useful setup under those rules. Recording that no-trade case prevents every small oscillator movement from becoming another discretionary entry.
The RSI guide provides a useful comparison with a bounded price-momentum oscillator. RSI’s familiar reference bands should not be copied onto cumulative OBV. Adding an oscillator also does not automatically establish independent evidence or a known improvement in performance.
Check futures volume, tick counts, and missing data
A volume series can represent traded contracts for a futures instrument, shares for a stock, or another unit supplied by its feed. NQ and MNQ have separate contract-volume series. Their absolute OBV readings should not be treated as directly comparable measurements of the same traded quantity.
Some forex or CFD feeds supply tick volume, counting price updates rather than exchange-traded contracts. Other symbols lack volume data. TradingView displays the information it receives, so availability can also differ by provider and chart interval. A missing value is not evidence of zero market participation.
Check the exact symbol, exchange or broker prefix, timeframe, session, and volume description before interpreting the line. Compare the same dated futures contract when investigating a discrepancy around rollover. Keep a record of the continuous-contract convention if that is the series you use for testing.
If the source has no usable volume, resolve the data issue before treating a flat or absent OBV as a market signal. The TradingView volume-data explanation describes provider-specific gaps and tick-volume availability.
A large volume spike does not simply age out of raw OBV
Change observation 2’s volume from 2,000 to 20,000 while keeping every close and later volume unchanged. That declining-close bar now subtracts an additional 18,000. Every subsequent raw OBV value in the sample is 18,000 lower than before.
The later per-bar additions are unchanged. A single spike can alter the cumulative baseline and the visual scale of a long chart, but it does not keep changing every later bar’s contribution. Raw OBV has no fourteen-bar window that automatically forgets the spike when it becomes old.
A rolling average can temporarily mix observations from before and after that jump. Comparisons spanning the spike also differ from comparisons entirely after it. Identify which measurement is affected before interpreting a large vertical move as continuing pressure.
Keep developing-bar readings separate from confirmed ones
Before a bar closes, its latest price and accumulated volume can still change. The sign comparison can change if the latest price crosses the preceding bar’s close. Recalculate the developing bar’s contribution against the previous completed OBV; do not repeatedly add the full accumulated volume as though each screen update were another completed bar.
For example, with previous completed OBV = 2,000 and previous close = 103, a developing bar at 102 with volume 500 gives a reference reading of 1,500. If it later trades at 104 with accumulated volume 800, the reference becomes 2,800. Those are successive states of one bar, not two additions to combine.
Keep the chosen confirmation interval explicit when creating alerts or reviewing a chart. Daily volume is incomplete during the trading day, and a higher-timeframe bar may still be developing after the current lower-timeframe candle has closed.
Compare OBV with other volume-based tools
| Tool | What enters its calculation | What the output describes |
|---|---|---|
| OBV | Close-to-close direction × bar volume | Cumulative signed volume |
| Accumulation/Distribution | Close location within the current bar’s range × volume | Cumulative range-position-weighted volume |
| PVT / VPT | Close-to-close fractional return × volume | Cumulative return-weighted volume |
| VWAP | Selected price and volume from an anchor | A volume-weighted average price |
| Volume Profile | Volume distributed across price levels | Where recorded activity was concentrated |
OBV and Accumulation/Distribution can move in opposite directions on one bar. Suppose the prior close is 106, while the current high is 110, low 90, close 105, and volume 1,000. OBV subtracts 1,000 because 105 is below 106. The A/D multiplier is [(105 − 90) − (110 − 105)] ÷ 20 = 0.5, so A/D adds 500.
PVT instead adds volume multiplied by the fractional close change. In that same example, 1,000 × (105 − 106) ÷ 106 is about −9.434. The three results differ because their weighting rules differ, not because one calculation failed.
The VWAP guide explains anchored volume-weighted price. The Volume Profile guide explains POC, value areas, and distribution by price. Keep those questions separate from OBV’s signed accumulation.
Test a complete method and size risk in price units
Freeze the instrument, data source, session, timeframe, smoothing choice, swing rule, confirmation, entry, stop, and exit before comparing results. Include failed breakouts, persistent divergences, large-volume events, and costs. Evaluate a later sample separately from the data used to select settings.
A scanner condition such as price below an average while OBV is above an average is a defined screening predicate. It is not automatically the same as two manually selected swing points forming divergence. Label the condition you actually tested instead of treating every “divergence” tool as an identical strategy.
OBV’s vertical distance is measured in volume units, so it cannot supply a stop distance in price points. Define the setup’s price invalidation, then use the position sizing guide to convert that distance and the instrument’s value per unit into a quantity fitting the risk budget. Allow for fees and execution uncertainty.
No universal OBV setting or winning percentage follows from the formula. Compare average gains, losses, sample size, and drawdown alongside win rate. Extra lines on the chart should have a defined purpose in that evaluation.

Compare HDP discounts
Lucid 30% · Tradeify 30% · TPT 50%.
See current offers ↗Eligible partner plans only.
OBV indicator FAQ
What is the OBV indicator?
On-Balance Volume is a running total of bar volume signed by close-to-close direction. It adds volume after a higher close, subtracts it after a lower close, and makes no change after an equal close. Read the series against price and its own relevant history.
How do you calculate OBV?
Start from the previous OBV and compare the current close with the previous close. Add the current bar’s volume if the close is higher, subtract it if lower, and retain the previous OBV if equal. Specify the initial reference when reproducing a calculation.
Does a green candle always add to OBV?
No. Standard OBV compares the current close with the previous close. A candle can close above its own open but below the preceding close, causing OBV to subtract volume. Check how the chart defines candle color.
Why is OBV unchanged on a high-volume bar?
If the current and previous closes are equal, the standard calculation adds zero regardless of that bar’s positive volume. An unchanged OBV reading therefore does not establish that there was no trading activity.
Is a positive OBV bullish and a negative OBV bearish?
The absolute value depends on the starting reference and earlier data. Adding a constant to the starting value shifts the later line without changing its additions. Compare direction and relevant swing relationships rather than applying a universal zero threshold.
What does Length 14 mean in TradingView OBV?
It belongs to the optional Smoothing section. The raw OBV calculation remains cumulative. With Type None, no additional moving-average line is displayed; selecting SMA and a length adds an average of OBV, not a fourteen-bar signed-volume total.
How do I add a 20-period OBV moving average?
Open the built-in OBV settings, choose Inputs, select SMA under Smoothing Type, and enter 20 in Length. This is an example configuration. Select None to remove that additional smoothing line while keeping raw OBV.
Why does OBV change when I change the chart timeframe?
The sign rule is applied to the new sequence of closes and bar volumes. In the constructed example, five small bars contribute −3,000 in total, while the same volumes aggregated into one rising-close bar contribute +15,000.
Can OBV identify institutional buying?
Its inputs do not contain trader identity. OBV assigns signs using bar closes and total supplied volume, so an institutional-accumulation interpretation cannot be verified from the formula alone. It also does not directly measure transaction-level buy/sell volume.
Can I use OBV on forex or index CFDs?
Check the exact feed’s volume information first. Some provide tick counts representing price updates; others lack volume. Keep the provider and timeframe consistent, and distinguish tick-volume OBV from an exchange-contract-volume series.
Does a volume spike disappear after 14 bars?
Raw OBV has no fourteen-bar expiry window. A one-off signed contribution remains in its cumulative baseline. A rolling smoothing line has its own window, so its behavior around the jump is a separate calculation.
Does OBV divergence mean price will reverse?
It describes a disagreement between the chosen price and OBV observations. Price can continue in its existing direction. Define the subsequent price confirmation, entry timing, and invalidation instead of treating divergence alone as a completed trade.
How is OBV different from Accumulation/Distribution?
OBV uses close-to-close direction to sign the whole bar’s volume. A/D weights volume by the close’s position inside the current high–low range. A bar can close below the preceding close yet above its own range midpoint, giving opposite contributions.
What is the best OBV setting or strategy win rate?
The formula establishes neither a universal best smoothing choice nor a win rate. Results depend on the market, feed, timeframe, rules, costs, and sample. Test a complete method and keep evaluation data separate from the sample used to select settings.
