在价格指标上,我们比较熟悉的就是平均价格。我们一般说的价格是平均价格,是总的成交金额/成交量。但是在Talib的价格指标上又是怎么计算的?
real =AVGPRICE(open, high, low, close)计算公式:

实例代码:
import talib as tb
import numpy as np
inputs = {
'open': np.random.random(1),
'high': np.random.random(1),
'low': np.random.random(1),
'close': np.random.random(1)
}
avgPrice=tb.AVGPRICE(inputs['open'],inputs['high'],inputs['low'],inputs['close'])价格的中位数
real=MEDPRICE(high, low)计算公式:

实例代码:
medPrice=tb.MEDPRICE(inputs['high'],inputs['low'])典型价格函数
real=TYPPRICE(high, low, close)计算公式

实例代码:
typePrice=tb.TYPPRICE(inputs['high'],inputs['low'],inputs['close'])加权收盘价
real=WCLPRICE(high, low, close)计算公式

实例代码
wclPrice=tb.WCLPRICE(inputs['high'],inputs['low'],inputs['close'])