OPEN-SOURCE SCRIPT
Aggiornato

OBV (Delta or regular)

487
This is a quite simple script to apply some choices to OBV.

  • You can choose to use regular OBV values or you can choose to use delta OBV values.
    Delta OBV values calculates the delta between selling volume and buying volume per bar to find discrepancies.
  • You can make the OBV a smoothed line or just keep the normal rigid line. Rigid line is default.
  • A secondary smoothed OBV line is added automatically with color change if the OBV is above or below the smoothed line.
  • You can set your desired MA from SMA, EMA, VWMA and WMA, The same will be applied to both lines if chosen to smooth them both.
  • Both lines are editable from the styles tab (visibility, color and line type)
    If you for some reason don't want color change on the secondary line, chose the same color for both color 1 and 2.


Simple delta OBV example:
If a red bar has a long lower wick, OBV will calculate the entire bar towards bearish volume, while the delta will check if there's more buying or selling happening in total. Some times you'll be able to catch divergences in the volume which implies a reversal might be in the making.
For instance more selling on a green candle making the OBV drop instead of increasing or vise versa.

Hopefully someone finds is useful.
Note di rilascio
This is a quite simple script to apply some choices to OBV.

  • You can choose to use regular OBV values or you can choose to use delta OBV values.
  • Delta OBV values calculates the delta between selling volume and buying volume per bar to find discrepancies.
  • You can make the OBV a smoothed line or just keep the normal rigid line. Rigid line is default.
  • A secondary smoothed OBV line is added automatically with color change if the OBV is above or below the smoothed line.
  • You can set your desired MA from SMA, EMA, VWMA and WMA, The same will be applied to both lines if chosen to smooth them both.
  • Both lines are editable from the styles tab (visibility, color and line type)
    If you for some reason don't want color change on the secondary line, chose the same color for both color 1 and 2.


Simple delta OBV example:
If a red bar has a long lower wick, OBV will calculate the entire bar towards bearish volume, while the delta will check if there's more buying or selling happening in total. Some times you'll be able to catch divergences in the volume which implies a reversal might be in the making.
For instance more selling on a green candle making the OBV drop instead of increasing or vise versa.

Hopefully someone finds is useful.
Note di rilascio
Added the possibility to plot irregularities / divergences in the volume.
It's set to false as default.

IF the buy volume is larger than 2X the sell volume on a red candle (closing price below open), then the OBV line will turn green.

IF the sell volume is larger than 2X the buy volume on a green candle (closing price above or equal to open price), then the OBV line will turn green.


EXAMPLE
I don't yet know how to use this properly. These divergences doesn't necessarily work like a normal divergence for RSI, MACD or any other oscillators. From my own experience, these irregularities just indicate that a shift in momentum is incoming. What you would expect to be a bullish divergence (buy volume > 2X sell volume on red candle) is not necessarily a bullish indication as you'll see in the screenshot below from QQQ.

Two green irregularities are printed at a top in February 2025, then price drops.
When the price recovers over the trend line, OBV does the same and prints a new green irregularity just above the trend line.

Hopefully someone finds it useful for their strategies, if not you can always just keep it disabled.

istantanea

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.