This commit is contained in:
louiscklaw
2025-01-31 21:11:36 +08:00
parent fcbf2fd71d
commit a5027646c7
13 changed files with 504 additions and 0 deletions

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