cloud live deploy: no Interactive Brokers (FIX) brokerage, --ib-fix-account / --ib-fix-user-name do not exist

未关闭
#692 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

@quantconnect-kronos 已经在做这个了。

开始于 2026年11月1日。

  • #694 来自 @quantconnect-kronos —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
cli, cloud

调研方向

Start with lean/models/click_options.py:24-25 and lean/models/cloud/__init__.py:21-33 to see how cloud brokerage options are generated from modules-1.14.json, then read lean/models/json_module.py (get_user_name(), the Auth0 flow) and lean/components/util/auth0_helper.py. The JSON file lives on the CDN, so part of the change is outside this repo and needs maintainer coordination. Done means --brokerage "Interactive Brokers (FIX)" resolves, the --ib-fix-* options appear in lean cloud live deploy --help, and the Auth0 brokerage name and ib-fix-linked-account are sent correctly.

由索引模型根据 Issue 内容生成。

描述

lean cloud live deploy cannot create an Interactive Brokers (FIX) deployment. The cloud brokerage list the CLI builds from modules-1.14.json has one Interactive Brokers entry, InteractiveBrokersBrokerage (the IB Gateway integration: ib-user-name, ib-account, ib-password, ib-host, ib-port, ...). There is no InteractiveBrokersFixBrokerage module and no ib-fix-* option, in interactive or non-interactive mode, so a member who moved an IB account to the FIX integration (the route the Interactive Brokers docs now recommend for live accounts) can only deploy through the web wizard and loses scripted deployments.

The API side already supports it: /live/create accepts the InteractiveBrokersFixBrokerage module with ib-fix-account, ib-fix-user-name and ib-fix-linked-account (the IB user name whose Client Portal authorization the wizard stored), and live/auth0/read answers brokerage=InteractiveBrokersFixBrokerage with userId=<IB user name> by returning the linked accounts for that user name. The gap is in the CLI.

Reproduce

Lean CLI 1.0.233 (master fba6da7, 2026-10-27), modules-1.14.json fetched from https://cdn.quantconnect.com/cli/modules-1.14.json on 2026-10-31.

$ lean cloud live deploy "My Project" --brokerage "Interactive Brokers (FIX)" --ib-fix-account U1234567 --ib-fix-user-name someuser --node L-MICRO --auto-restart no --notify-order-events no --notify-insights no
Error: No such option '--ib-fix-account'. (Did you mean one of: '--eze-trading-account', '--ib-account', '--terminal-link-emsx-account'?)

$ lean cloud live deploy "My Project" --brokerage "Interactive Brokers (FIX)" --node L-MICRO --auto-restart no --notify-order-events no --notify-insights no
Error: Invalid value for '--brokerage': 'Interactive Brokers (FIX)' is not one of 'Paper Trading', 'Interactive Brokers', 'Tradier', 'Oanda', 'Bitfinex', 'Coinbase Advanced Trade', 'Binance', 'Zerodha', 'Samco', 'Terminal Link', 'Trading Technologies', 'Kraken', 'CharlesSchwab', 'Bybit', 'TradeStation', 'Alpaca', 'Tastytrade', 'Eze', 'dYdX', 'Webull', 'Public', 'ClearStreet'.

$ lean cloud live deploy --help | grep -- --ib-
  --ib-user-name TEXT             Your Interactive Brokers username
  --ib-account TEXT               Your Interactive Brokers account id
  --ib-password TEXT              Your Interactive Brokers password
  --ib-host TEXT                  External Interactive Brokers Gateway Host
  --ib-port TEXT                  External Interactive Brokers Gateway Port
  --ib-weekly-restart-utc-time TEXT
  --ib-financial-advisors-group-filter TEXT

InteractiveBrokersFixBrokerage as the --brokerage value fails the same way, and the interactive wizard offers the same 22 names.

Where

  • lean/models/__init__.py:20-26 downloads modules-1.14.json; lean/models/cloud/__init__.py:21-33 keeps the entries whose platform contains cloud and whose type contains brokerage as cloud_brokerages. The file has no FIX entry, so lean/models/click_options.py:24-25 never generates the options and lean/commands/cloud/live/deploy.py:290 (non_interactive_config_build_for_name) cannot resolve the name.
  • The CLI already has the pattern a FIX entry needs: an oauth-token configuration (lean/models/configuration.py:434-448, AuthConfiguration) with require-user-name: true, as CharlesSchwabBrokerage uses (charles-schwab-oauth-token + a charles-schwab-account-number choice filtered on it). JsonModule.get_user_name() (lean/models/json_module.py:178-204) reads <prefix>-user-name from the options, and the Auth0 flow (json_module.py:311-330, lean/components/util/auth0_helper.py:19-44) calls live/auth0/read with userId and offers accounts from the response as the account choice.

Proposed change

  1. Add an InteractiveBrokersFixBrokerage entry to the modules JSON (display id Interactive Brokers (FIX), platform: ["cloud"], type: ["brokerage"], minimum seat as the Gateway entry) with:
    • ib-fix-oauth-token: type: oauth-token, require-user-name: true (so --ib-fix-user-name is the IB user name the CLI authorizes with, matching get_user_name()'s <prefix>-user-name convention);
    • ib-fix-account: input-method: choice, filtered on the token, populated from the accounts the Auth0 read returns;
    • the settings sent to /live/create must include ib-fix-linked-account set to the same IB user name (the factory requires it), so either the module maps it from the user name or the CLI adds it in get_settings() for this module.
  2. The Auth0 brokerage name the CLI sends is the lowercased display name (json_module.py:318: self._display_name.lower()), which for the new entry would be interactive brokers (fix); live/auth0/authorize expects interactivebrokers and live/auth0/read accepts interactivebrokersfixbrokerage / interactivebrokersbrokerage. The CLI needs to send the module id (or an explicit auth0-brokerage field from the JSON) rather than the display name, or the API needs the alias.
  3. Document the new options on the lean cloud live deploy page (today it lists the Gateway options only).

Untested: no diff, since the change spans the CDN modules file and the CLI.

Open questions

  • Should --ib-fix-user-name reuse the Gateway-style free text, or should the CLI require the user name to already be linked (the wizard's "+ Add Account" flow opens the IB login; the CLI's authorize URL does the same with userId)?
  • The paper-account rule (FIX does not support DU accounts) belongs in the module's validation.

Intercom conversation 215476644846297.

主要语言
Python
星标
329
派生
169
平均合并
4 天 18 小时
30 天内合并 PR
9

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。