Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.OBV
Calculates the On Balance Volume.
talib.OBV(inReal)
talib.OBV(inReal, inPriceV)Examples
Compute the On Balance Volume from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.OBV(records)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.OBV(records.Close, records.Volume)
Log(ret)Returns
| Type | Description |
numeric array | Indicator values, the same length as the input; the leading values without enough data are |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line data (the close price and volume are used) or a numeric array of close prices. |
inPriceV |
| No | Volume: not needed when |
See Also
Remarks
TA-Lib equivalent: OBV(Records[Close],Records[Volume]) = Array(outReal).