On-Balance Volume (OBV)


obv = onbalvol(closep, tvolume)
obv = onbalvol([closep tvolume])
obvts = onbalvol(tsobj)
obvts = onbalvol(tsobj, 'ParameterName', ParameterValue, ...)



Closing price (vector)


Volume traded


Financial time series object


obv = onbalvol(closep, tvolume) calculates the On-Balance Volume (OBV) from the stock closing price (closep) and volume traded (tvolume) data.

obv = onbalvol([closep tvolume]) accepts a two-column matrix representing the closing price (closep) and volume traded (tvolume), in that order.

obvts = onbalvol(tsobj) calculates the OBV from the stock data in the financial time series object tsobj. The object must minimally contain series names Close and Volume. The obvts output is a financial time series object with the same dates as tsobj and a series named OnBalVol.

obvts = onbalvol(tsobj, 'ParameterName', ParameterValue, ...) accepts parameter name/ parameter value pairs as input. These pairs specify the name(s) for the required data series if it is different from the expected default name(s). Valid parameter names are

  • CloseName: closing prices series name

  • VolumeName: volume traded series name

Parameter values are the character vectors that represent the valid parameter names.


collapse all

Calculate the On-Balance Volume (OBV)

This example shows how to calculate the OBV for Disney stock and plot the results.

load disney.mat
dis_OnBalVol = onbalvol(dis);
title('On-Balance Volume for Disney')

Related Examples


Achelis, Steven B., Technical Analysis from A to Z, Second printing, McGraw-Hill, 1995, pp. 207 - 209.

See Also

Introduced before R2006a

Was this topic helpful?