OBV Divergence Strategy: How to Build It in Arrow Algo

An OBV divergence strategy hunts for the moments when volume stops agreeing with price. On-Balance Volume, created by Joe Granville in 1963, runs on a famous premise: volume precedes price. When price grinds to a new high but OBV refuses to follow, the buyers behind the move are thinning out — and the chart is often the last to admit it. Divergence trading turns that disagreement into a signal.
What Is OBV Divergence?
On-Balance Volume is a running total: add the period’s volume when price closes up, subtract it when price closes down. The absolute number is meaningless — what matters is the direction and shape of the line, as Investopedia explains. OBV divergence occurs when price and OBV make opposite patterns at extremes:
- Bearish divergence: price prints a higher high while OBV prints a lower high. The rally is running on less volume than the previous one.
- Bullish divergence: price prints a lower low while OBV prints a higher low. Selling pressure is drying up even as price slips.
The logic: OBV tracks conviction. Price can drift on thin participation, but sustained moves need volume behind them.
Why Does Volume Divergence Matter?
Every price move has two readings — how far it went, and who showed up for it. A breakout on collapsing OBV is a party with no guests: the new high exists, but the accumulation that sustains new highs does not. Divergence does not time reversals precisely. What it does is flag deteriorating quality early, often several swings before the turn. That makes it stronger as a filter and a warning system than as a standalone trigger — the same caveat that applies to MACD divergence.
Making Divergence Mechanical
“Spot the divergence” is easy for eyes and vague for rules. A systematic version compares extremes over a fixed window:
- Price condition: the current close is the highest close of the last 40 bars.
- OBV condition: OBV is below its own highest value from that same window.
- Together: a new price high without a new OBV high — bearish divergence, defined without judgement calls.
Mirror the logic with lowest values for the bullish version. The window length sets sensitivity: shorter windows catch minor divergences, longer ones only the major turns.
The Rule Set for an OBV Divergence Strategy
Bullish Divergence Reversal
- Setup: price makes a 40-bar low; OBV holds above its 40-bar low.
- Trigger: price closes back above a short moving average (e.g. 10 EMA) — the turn has begun. Never enter on the divergence alone.
- Stop: below the divergence low. Target: the prior swing high, or a trailing exit.
OBV as a Breakout Filter
- Rule: only take breakout entries when OBV sits above its own 20-period moving average.
- Effect: breakouts backed by volume pass; hollow ones — the classic fake-out fuel — get skipped.
Building It in Arrow Algo
- Add an OBV block and connect your candle feed.
- Use Max/Min blocks over your chosen window on both price and the OBV output — comparing current values against those extremes defines the divergence mechanically.
- Combine the two conditions with an AND gate, then add your trigger: a crossover block on price and a short EMA.
- For the filter variant, add a moving average on OBV and gate your existing breakout entries with it.
- Backtest on Binance, Coinbase, or HyperLiquid data — and remember exchange volume differs between venues, so test where you trade.
What Are the Common Mistakes?
- Trading divergence without a trigger. Divergences can stretch on for weeks while the trend keeps paying. The price confirmation is the entry; the divergence is only the setup.
- Reading OBV’s absolute level. The line’s value depends on where the data starts. Only slopes and relative extremes carry information.
- Ignoring venue differences. Crypto volume is per exchange. OBV on one venue’s thin book can disagree with the market’s true flow.
- Over-tight windows. Ten-bar “divergences” appear constantly and mean little. Structural turns show up on 30-50 bar comparisons.
What Should You Remember?
- An OBV divergence strategy trades the gap between price extremes and volume conviction.
- Bearish: higher price high, lower OBV high. Bullish: lower price low, higher OBV low.
- Divergence is a setup, never a trigger — demand price confirmation before entering.
- OBV above its own moving average also makes a clean volume filter for breakout systems.
- Max/Min blocks in Arrow Algo turn a chart-reading skill into mechanical rules — the complete OBV guide has the full background.
Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.
Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who’ve made the switch to systematic trading.