TA-Lib学习研究笔记——Price Transform (五)
1.AVGPRICE
Average Price
函数名:AVGPRICE
名称:平均价格函数
语法:
real = AVGPRICE(open, high, low, close)
df['AVGPRICE'] = tlb.AVGPRICE(df['open'],df['high'],df['low'],df['close'])
# 做图
df[['close','AVGPRICE']].plot(title='AVGPRICE')
plt.grid() #启用网格
plt.legend(['close','AVGPRICE']) # 设置图示
plt.show()
2.MEDPRICE
Median Price
函数名:MEDPRICE
名称:中位数价格
语法:
real = MEDPRICE(high, low)
df['MEDPRICE'] = tlb.MEDPRICE(df['high'],df['low'])
# 做图
df[['close','MEDPRICE']].plot(title='MEDPRICE')
plt.grid() #启用网格
plt.legend(['close','MEDPRICE']) # 设置图示
plt.show()
3.TYPPRICE
Typical Price
函数名:TYPPRICE
名称:代表性价格
语法:
real = TYPPRICE(high, low, close)
df['TYPPRICE'] = tlb.TYPPRICE(df['high'],df['low'],df['close'])
# 做图
df[['close','TYPPRICE']].plot(title='TYPPRICE')
plt.grid() #启用网格
plt.legend(['close','TYPPRICE']) # 设置图示
plt.show()
4.WCLPRICE
Weighted Close Price
语法:
real = WCLPRICE(high, low, close)
df['WCLPRICE'] = tlb.WCLPRICE(df['high'],df['low'],df['close'])
# 做图
df[['close','WCLPRICE']].plot(title='WCLPRICE')
plt.grid() #启用网格
plt.legend(['close','WCLPRICE']) # 设置图示
plt.show()