FutunnOpen / py-futu-api

富途 OpenAPI Python SDK
Apache License 2.0
1.03k stars 221 forks source link

Unable to connect as "NameError: name 'OpenQuoteContext' is not defined" #106

Closed andyquek closed 3 years ago

andyquek commented 3 years ago

Hi All

I'm new to python and am facing some issue when i tried to connect using OpenQuoteContext. I've referred to the video on Youtube and it seems that everyone are able to call the method "OpenQuoteContxt" but I'm getting an error.

Youtube Link: https://www.youtube.com/watch?v=qnNzQO2LOtE

Below is the my code and error:

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, page_req_key = quote_ctx.request_history_kline('HK.00700', start='2019-09-11', end='2019-09-18', max_count=5) # 5 per page, request the first page

Traceback (most recent call last): File "C:\Users\andyq\PycharmProjects\trading\Momo_API.py", line 3, in <module> quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111) NameError: name 'OpenQuoteContext' is not defined

Milerli commented 1 month ago

how to fix this issue?