用get_stock_list_in_sector函数获取沪深300历史数据,返回值为空,但是当前沪深300的成分股可以完整返回,不知道错误出在哪里,请大佬帮忙看下
def init(ContextInfo):
return
def after_init(ContextInfo):
sector_name = '沪深300'
adjusted_time = '20230612'
# 不传参数,返回最新的板块成分数据
newest_sector_list = ContextInfo.get_stock_list_in_sector(sector_name)
print(f'板块最新成分股: {newest_sector_list}')
# 根据历史时间,返回历史成分数据
history_sector_stock_list = ContextInfo.get_stock_list_in_sector(sector_name, '20230612')
print(f'板块历史成分股: {history_sector_stock_list}')
def handlebar(ContextInfo):
return

上图可见,最新板块成分股可以返回,但历史成分股返回为空(本地数据是齐全的)
请大佬们帮忙看一下,谢谢 |