This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


On-Balance Volume (OBV)


obv = onbalvol(closep,tvolume)
obv = onbalvol([closeptvolume])
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([closeptvolume]) 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

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')


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

Introduced before R2006a

Was this topic helpful?