成交时间

适用市场

市场品种
香港市场股票、期权、窝轮、牛熊证、界内证、ETFs、期货
美国市场股票、期权、ETFs、期货
A股市场股票、ETFs
新加坡市场期货
日本市场期货

execution_time

接口说明

通过成交 ID 查询成交时间

你可以通过以下 2 个函数获得成交 ID :

  1. 查询成交 ID
  2. 订单的成交 ID
execution_time(excecutionid,time_zone=TimeZone.MARKET_TIME_ZONE)

参数

参数名类型说明默认值范围
excecutionidstring订单ID----
time_zoneTimeZone时区TimeZone.MARKET_TIME_ZONE--

返回

返回类型:datetime

示例说明

查询成交 ID 为“10000000000000001”的成交时间。

executiontime = execution_time(excecutionid="10000000000000001",time_zone=TimeZone.MARKET_TIME_ZONE)
print(executiontime)
print(executiontime.strftime("%Y-%m-%d %H:%M:%S"))  # 格式化日期和时间
print(executiontime.hour)  # 打印小时
print(executiontime.minute)  # 打印分钟
print(executiontime.second)  # 打印秒

示例返回值

2023-07-31 09:30:00-04:00
2023-07-31 09:30:00
9
30
0