RSI强弱指标
num = -1
close = history_bars('RB00',100,'1d','close',include_now=True)
#就一个周期参数就行了
rsi = talib.RSI(close,timeperiod=6)
print(rsi[num])
威廉指标
num = -1
close = history_bars('RB00',100,'1d','close',include_now=True)
high = history_bars('RB00',100,'1d','high',include_now=True)
low = history_bars('RB00',100,'1d','low',include_now=True)
will = talib.WILLR(high,low,close,timeperiod=14)
print(will[num])
TRIX三重指数平均
num = -1
close = history_bars('RB00',100,'1d','close',include_now=True)
trix = talib.TRIX(close,timeperiod=12)
print(trix[num])
TR真实波幅
num = -1
close = history_bars('RB00',100,'1d','close',include_now=True)
high = history_bars('RB00',100,'1d','high',include_now=True)
low = history_bars('RB00',100,'1d','low',include_now=True)
tr = talib.TRANGE(high,low,close)
print(tr)
#tr的均值就是我们常用的atr指标。talib自带的有atr不过计算出来的值和图表不对,所以我这里计算tr然后均值得到的就一样了
print(talib.SMA(tr,14))