就目前使用的情况看,希望添加行业行情数据查询,通过目前的接口获取总是困难的,代码如下:
industry_info = get_industry(stock, date=context.current_dt)
industry_code = industry_info[stock]['zjw']['industry_code']
# 获取行业指数(中证行业指数)
industry_index = '8810' + industry_code[:3] # 例如:881001 农林牧渔
print(industry_index)
close_prices = get_price(industry_index, count=window, fields='close')['close']
print(close_prices)
到这个地方,就报错了,那么我需要怎么获取行业的行情数据呢?
2025-03-25