OBV (Function)
The OBV function calculates "On Balance Volume".
Syntax
OBV
Returns (Double)
A numeric value containing OBV for the current bar.
Parameters
None
Remarks
Mathematically, the cumulative OBV formula is represented as:
OBV = å[(C-Cp / |C-Cp|)*V]
. . . where
C is the current period’s closing price.
Cp is the previous period’s closing price.
|C - Cp| is the absolute value of the difference between the two closing prices.
Since any number divided by itself is equal to one (1), the only bearing the expression in parenthesis has is on the sign. If the previous Close is greater than the current Close, the sign will be negative. If the previous Close is less than the current Close, the sign will be positive.
Therefore, the function either subtracts the current volume from the running total of the OBV line or adds current volume to the running total of the OBV line.
Example
Value1 = OBV;
Reference
Granville, Joseph E. Granville's New Key to Stock Market Profits. Englewood Cliffs, NJ, Prentice-Hall, 1963.