Skip to content

可用资金不足的"废单"被当做ACCEPTED? #21

Description

@cool-colo

如图中所示的废单, 好像被认为是ACCEPTED

Image

QMT导出的文本:
选择 资金账号 委托时间 证券代码 证券名称 买卖标记 委托状态 委托量 成交数量 已撤数量 委托价格 成交均价 冻结金额 合同编号 废单原因 投资备注 策略名称 订单编号 分支机构
86904088 10:38:22 300876 蒙泰高新 限价买入 废单 500 0 500 14.35 0.00 0.00 xt1090533590 [COUNTER][260200][可用资金不足][fund_account=86904088,money_type=0,p_occur_balance=7180.50,v_enable_balance_t=360.82] NT:O-20260630-023957-001-001-3563|O-20260630-023957-001-001-3563 nautilus_model_predicti 1090533590

claude分析的root cause:

Root cause confirmed. The QMT 废单 status code is ORDER_JUNK = 57.

The proxy's _infer_order_lifecycle_status (trading_session_manager.py:736) does NOT handle code 57:

  • status_msg = [COUNTER][260200][可用资金不足]... → contains none of reject/废/拒. (The error message uses 可用资金不足, not 废单.)
  • raw_status_code == 54? No, it's 57.
  • order_volume > 0 and traded_volume >= order_volume? No (traded=0).
  • traded_volume > 0? No.
  • raw_status_code == 50? No.
  • if raw_status_code: → 57 is truthy → returns ACCEPTED.

So a 废单 (57) is mislabeled ACCEPTED. The adapter then emits OrderAccepted

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions