说明 / 示例
# 4)根据委托号获取委托或成交信息 get_value_by_order_id()
用法: get_value_by_order_id(orderId, accountID, strAccountType, strDatatype)
释义: 根据委托号获取委托或成交信息。
参数:
orderId:string,委托号。
accountID:string,资金账号。
strAccountType:string,账号类型,可选值:
‘FUTURE’:期货
‘STOCK’:股票
‘CREDIT’:信用
‘HUGANGTONG’:沪港通
‘SHENGANGTONG’:深港通
‘STOCK_OPTION’:期权
strDatatype:string,数据类型:
‘ORDER’:委托
‘DEAL’ :成交
返回: pythonObj
示例:
```py
def init(ContextInfo):
ContextInfo.accid = '6000000248'
def handlebar(ContextInfo):
orderid = get_last_order_id(ContextInfo.accid, 'stock', 'order')
print(orderid)
obj = get_value_by_order_id(orderid,ContextInfo.accid, 'stock', 'order')
print(obj.m_strInstrumentID)
```