当我导入from temp import get_IB_historical_data
时,python会显示一条错误消息cannot import name 'get_IB_historical_data'
。
我已在线搜索,但找不到解决方案。你们能请我建议我如何解决它吗?
临时py代码可以在下面找到: https://gist.github.com/robcarver17/f50aeebc2ecd084f818706d9f05c1eb4
我的代码如下:
from DataDownload import get_IB_historical_data
contractHHI = contract()
contractHHI.symbol = "HHI.HK"
contractHHI.secType = "FUT"
contractHHI.exchange = "HKFE"
contractHHI.currency = "HKD"
contractHHI.lastTradeDateOrContractMonth = "201811"
raw_df = get_IB_historical_data(ibcontract = contractHHI, durationStr="1 D", barSizeSetting="1 min", tickerid=DEFAULT_HISTORIC_DATA_ID)
在此先感谢您为您提供的帮助!