update,
This commit is contained in:
18
kennethmak226/test/helloworld_1 copy 2.py
Normal file
18
kennethmak226/test/helloworld_1 copy 2.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from futu import *
|
||||
from pprint import pprint
|
||||
|
||||
# 创建行情对象
|
||||
quote_ctx = OpenQuoteContext(host='25.10.49.37', port=11111)
|
||||
|
||||
ret, data = quote_ctx.get_market_snapshot(['HK.00388', 'HK.00700'])
|
||||
if ret == RET_OK:
|
||||
print(data)
|
||||
print(data['code'][0]) # Take the first stock code
|
||||
print(data['code'].values.tolist()) # Convert to list
|
||||
print(data['name'].values.tolist()) # Convert to list
|
||||
else:
|
||||
print('error:', data)
|
||||
|
||||
quote_ctx.close() # After using the connection, remember to close it to prevent the number of connections from running out
|
||||
|
||||
print('done')
|
Reference in New Issue
Block a user