You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IBKR模拟账户限价下单报错“Can not contain field # 8089”问题排查求助

IBKR模拟账户限价下单报错“Can not contain field # 8089”问题排查求助

大家好,我现在用IBKR的模拟交易账户(paper trading)尝试提交NVDA的限价买单,但是一直收到错误提示“Can not contain field # 8089”,反复核对请求Payload后还是没找到问题,想请教下有没有朋友遇到过类似情况,或者能帮我排查下问题出在哪?

1. 下单请求Payload

我提交的请求JSON如下,目标是挂1股NVDA的当日有效限价买单,价格195美元:

{
  "orders": [
    {
      "acctId": "DUM597952",
      "conid": 4815747,
      "conidex": "4815747@SMART",
      "manualIndicator": true,
      "extOperator": "test-operator",
      "secType": "STK",
      "cOID": "NVDA-LMT-BUY-1",
      "orderType": "LMT",
      "price": 195,
      "quantity": 2,
      "side": "BUY",
      "ticker": "NVDA",
      "tif": "DAY",
      "quantity": 1,
      "isSingleGroup": false,
      "outsideRTH": false,
      "isCcyConv": false,
      "listingExchange": "NASDAQ"
    }
  ]
}

注:我后来发现Payload里不小心重复写了quantity字段(先后写了2和1),删掉重复项重新提交后,还是报完全一样的错误。

2. IBKR返回的错误响应

提交请求后收到的错误返回内容如下:

{
  "error": "\"BUY 1 NVDA NASDAQ.NMS @ 195.00\"\nCan not contain field # 8089",
  "cqe": {
    "post_payload": {
      "snapshots": [
        {
          "balances": {
            "USD": "249795.2",
            "BASE": "249795.2"
          }
        }
      ],
      "side": "s",
      "rejections": [
        "Can not contain field # 8089"
      ],
      "account_id": "DUM597952",
      "order_currency": "USD",
      "sec_type": "STK",
      "conid": "4815747",
      "exchange": "ISLAND",
      "order_id": "0"
    },
    "request_method": "POST"
  },
  "action": "order_submit_issue"
}

3. 我使用的下单代码(FastAPI转发接口)

我通过FastAPI写了一个转发接口,调用IBKR本地Gateway的API提交订单,代码如下:

@router.post("/{account_id}/new",)
def place_order(account_id: str, order_data: OrderRequest):
    """ Place a trade order on IBKR. """
    try:
        logger.info(f"Placing order for account: {account_id}")
        url = f"https://localhost:5000/v1/api/iserver/account/{account_id}/orders"
        response = requests.post(url, json=order_data.dict(), verify=False)
        logger.info(f"✅ Order response: {response.text}")
        
        # 下面是我尝试过的另一种提交方式,结果仍报错
        # response = SESSION.post(
        #     f"{BASE_URL}/iserver/account/{account_id}/orders",
        #     data=json.dumps([order_data.dict()]),
        #     headers={"Content-Type": "application/json"}
        # )
        # logger.info("Equity Market Order Response:", response.json())

        if response.status_code == 200:
            return response.json()
        else:
            logger.error(f"Order placement failed: {response.status_code}")
            raise HTTPException(status_code=response.status_code, detail="Failed to place order")
    except requests.RequestException as e:
        logger.error(f"Exception placing order: {e}")
        raise HTTPException(status_code=503, detail="IB Gateway not reachable")

我查了IBKR的官方API文档,没找到字段编号8089对应的具体字段名,也不确定是不是Payload里多传了IBKR不接受的字段(比如manualIndicator、extOperator这类),有没有朋友能指点下排查方向?


内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 07:19:30