问题:回测接口传入的股票代码,但是无法获取到历史行情数据,请问是什么原因,谢谢~
代码示例:
self.api = TqApi(backtest=TqBacktest(start_dt=start_date, end_dt=end_date), _stock=True)
k_lines = self.api.get_kline_serial(“SSE.603690”, 10) # 订阅自定义的N秒K线
while True:
self.api.wait_update()
if self.api.is_changing(k_lines .iloc[-1], “datetime”):
last_line = k_lines .iloc[-1]
print(self.get_datetime_str(last_line .datetime), last_line .close)
报错信息如下:
C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe C:/Users/Administrator/Desktop/arbitragePorject/strategy_demo_20200515.py
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
2020-05-16 18:22:53.411801: 实例化策略完成!
WARNING – 回测结束
Process finished with exit code 0