欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → 【zzc_python】talib常用指标范例

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有7526人关注过本帖平板打印复制链接

主题:【zzc_python】talib常用指标范例

帅哥哟,离线,有人找我吗?
yukizzc
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
  发帖心情 Post By:2019/11/27 10:42:01 [只看该作者]

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))

[此贴子已经被作者于2019/11/27 22:20:04编辑过]

 回到顶部