get_price获取数据出错

用户头像哈基咪
2023-08-04 发布

cons_lists=list(get_concept_relate('now', levels=['GN001001'])['concept_thscode']) #获取概念板块列表
value = get_price(securities=cons_lists,end_date='20230803',fre_step='1d',fields=['open','prev_close'],skip_paused=False,fq=None,bar_count=1,is_panel=1)
print(value)

AttributeError: 'NoneType' object has no attribute 'type'

提示这样的错误。

如果securities直接用具体数组

value = get_price(securities=['885570.TI', '885932.TI', '885916.TI', '885943.TI'],end_date='20230803',fre_step='1d',fields=['open','prev_close'],skip_paused=False,fq=None,bar_count=1,is_panel=1)
print(value)

这样是不会出错的,求解,上个月回测还能跑

评论

用户头像
2023-08-04 12:58:15

用list()会出错,改成tolist()

cons_lists=get_concept_relate('now', levels=['GN001001'])['concept_thscode'].tolist()

评论
用户头像
2023-08-11 11:57:07

用list()会出错,改成tolist()

cons_lists=get_concept_relate('now', levels=['GN001001'])['concept_thscode'].tolist()

评论

需要帮助?

试试AI小助手吧