indicator · own pane · open source

On-Balance Volume indicator

On-Balance Volume is a free open-source indicator. On-Balance Volume (OBV) is the running total of volume signed by the bar's direction — a… Deepwick Script runs a subset of Pine Script.

v1Updated 3 Oct 2026▲ 0 users
Running…
Loading chart…

What On-Balance Volume does

On-Balance Volume (OBV) is the running total of volume signed by the bar's direction — a cumulative tape that leads price on breakouts.

  • Rising OBV + flat price = accumulation; falling OBV + flat price = distribution.
  • Divergences between OBV and price are the classic smart-money signal.

Source code

Deepwick Script, a subset of Pine Script · read-only

//@version=6
indicator("On-Balance Volume", overlay=false)
src = input.source(close, "Source")
colorLine = input.color("color.blue", "Color  Line")
chg = src - src[1]
dir = chg > 0 ? 1 : chg < 0 ? -1 : 0
ta.obv = ta.cum(dir * volume)
p_OBV = plot(ta.obv, "OBV", color=colorLine, linewidth=2)
alertcondition(ta.crossover(ta.obv, ta.highest(ta.obv, 50)), "New 50-bar OBV high", "OBV printed a new 50-bar high")
alertcondition(ta.crossunder(ta.obv, ta.lowest(ta.obv, 50)), "New 50-bar OBV low", "OBV printed a new 50-bar low")

Comments

No comments yet.

Sign in to comment.