行业知识
通过python 获取股票数据的API接口
2026-11-09 07:13:43
来源:互联网转载
(一)获取当前 K线 对应时间的时间戳函数ContextInfo.get_ bar_timetag()
���法: ContextInfo.get_bar_timetag (index)。
()释义:获取当前K线对应时间的时间戳。
参数:number:K线索引号。
()返回:number。
示例:
def handlebar(ContextInfo): index = ContextInfo.barpos print(ContextInfo.get_bar_timetag (index))
(二)获取指数成份股函数 ContextInfo.get_ sector()
用法:ContextInfo.get_ sector(sector, realtime)。
释义:获取板块成份股,只支持取指数成份股。
下一篇:服务器里面怎么重置出生点?