Files
kennethmak226/test/helloworld_1 copy 2.py
louiscklaw db0d4cdc37 update,
2025-02-01 02:03:16 +08:00

19 lines
580 B
Python

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')