## 原型

```python
get_value_by_order_id(orderId, accountID, strAccountType, strDatatype)
```

## 释义

get_value_by_order_id 是 QMT 内置 Python 中用于根据委托号获取委托或成交信息的接口。

研究：官方目录未明确；回测：官方目录未明确；模拟：官方目录未明确；实盘：官方目录未明确。

## 参数

| 参数 | 是否必填 | 官方原始定义 |
|---|---:|---|
| `orderId` | 是 | orderId |
| `accountID` | 是 | accountID |
| `strAccountType` | 是 | strAccountType |
| `strDatatype` | 是 | strDatatype |

## 返回值

委托对象 或 成交对象

## 示例

```python
python返回值

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)

调用方法

python

# 区分策略，添加策略名称参数 strategyName

get_last_order_id(accountID, strAccountType, strDatatype, strategyName)

# 不区分策略

get_last_order_id(accountID, strAccountType, strDatatype)
```

## 详细说明

调用方法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' ：成交 | 必填 |

### 返回值

委托对象 或 成交对象
