talib.OBV

talib.OBV()函数用于计算On Balance Volume(能量潮指标)

talib.OBV()函数返回一维数组。 array

talib.OBV(inReal) talib.OBV(inReal, inPriceV)

inReal参数用于指定K线数据。 inReal true {@struct/Record Record}结构数组 / 数值数组 inPriceV参数用于指定K线数据。 inPriceV false {@struct/Record Record}结构数组


function main() {
    var records = exchange.GetRecords()
    var ret = talib.OBV(records, records)
    Log(ret)
}

import talib
def main():
    records = exchange.GetRecords()
    ret = talib.OBV(records.Close, records.Volume)
    Log(ret)

void main() {
    auto records = exchange.GetRecords();
    auto ret = talib.OBV(records);
    Log(ret);
}

OBV()函数在talib库文档中的描述为:OBV(Records[Close],Records[Volume]) = Array(outReal)