# can_cancel_order - 查询委托是否可撤销 查询委托是否可撤销 规范地址:https://quantx.asia/docs/qmt/builtin-python/api-reference/can-cancel-order/ 适用平台:QMT 内置 Python;运行环境:builtin-python 内容更新:2026-10-11 资料核验:2026-10-11 资料来源: - [官方来源](https://dict.thinktrader.net/VBA/check_sheet.html) --- ## 功能说明 查询委托是否可撤销 ## 原型 ```python can_cancel_order(orderId, accountID, strAccountType) ``` ## 参数 rderId,string,委托号; accountID,string,资金账号; strAccountType,string,账号类型,有"FUTURE","STOCK","CREDIT","HUGANGTONG","SHENGANGTONG","STOCK_OPTION"; ## 返回值 bool,是否可撤,True或False ## 示例 以下代码依据官方示例整理缩进,并将旧式 print 写法改为函数调用;账号使用占位值。 ```python def init(ContextInfo): ContextInfo.accid = 'YOUR_ACCOUNT_ID' def handlebar(ContextInfo): order_id = get_last_order_id(ContextInfo.accid, 'STOCK', 'ORDER') print(can_cancel_order(order_id, ContextInfo.accid, 'STOCK')) ``` ## 补充说明 can_cancel_order (orderId,accountID,strAccountType); ## 官方来源 [迅投 QMT 官方函数检索表](https://dict.thinktrader.net/VBA/check_sheet.html),条目 `can_cancel_order`。本页属于 QMT 内置 Python 接口;原站函数检索表同时收录其他语言,不能按网页路径将本条目误归为 VBA。网页核对日期:2026-10-11。