update,
This commit is contained in:
22
kennethmak226/test/helloworld_1.py
Normal file
22
kennethmak226/test/helloworld_1.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from futu import *
|
||||
from pprint import pprint
|
||||
|
||||
# 创建行情对象
|
||||
# quote_ctx = OpenQuoteContext(host='25.10.49.37', port=11111)
|
||||
|
||||
# deal_list_query error: 为保证交易的安全,跨网通信,交易连接需要加密。如果无需跨网通信,可以将配置文件中的监听
|
||||
# 地址修改为127.0.0.1
|
||||
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.HK, host='25.10.49.37', port=11111, security_firm=SecurityFirm.FUTUSECURITIES)
|
||||
|
||||
|
||||
ret, data = trd_ctx.deal_list_query()
|
||||
if ret == RET_OK:
|
||||
print(data)
|
||||
if data.shape[0] > 0: # 如果成交列表不为空
|
||||
print(data['order_id'][0]) # 获取当日成交的第一个订单号
|
||||
print(data['order_id'].values.tolist()) # 转为 list
|
||||
else:
|
||||
print('deal_list_query error: ', data)
|
||||
trd_ctx.close()
|
||||
|
||||
print('done')
|
Reference in New Issue
Block a user