Closed Gary951024 closed 5 years ago
Traceback (most recent call last):
File "d:/Users/AlgoTrade/Python/Test.py", line 1, in
要改一下 d:\Users\AlgoTrade\Python\futu.py
这个文件名,不要用 futu.py
您好,麻烦您将futu-api和OpenD都进行升级,再获取相关数据。 如还有问题,请在QQ群(108534288)咨询,谢谢。
Ok, resolved.
Not an issue of file name,
ImportError: cannot import name 'OpenQuoteContext' from 'futu' (/Users/yezli/miniconda3/lib/python3.8/site-packages/futu/__init__.py)
from futu import OpenQuoteContext Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'OpenQuoteContext' from 'futu' (C:\Users\cxsjx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\futu\__init__.py)
如果我用回以前futuqant 的module 的話則沒有問題 但用futu這個module 的話 他會顯示沒有OpenQuoteContext
import futu as ft
quote_ctx = ft.OpenQuoteContext(host='127.0.0.1', port=11111)
print(quote_ctx.get_market_snapshot('HK.00700'))
quote_ctx.close()