Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 86 variants Ping, Quote(QuoteArgs), Snapshot(SnapshotArgs), Sub(SubArgs), Kline(KlineArgs), Orderbook(OrderbookArgs), Ticker(TickerArgs), Rt(RtArgs), Static(StaticArgs), Broker(BrokerArgs), PlateList(PlateListArgs), PlateStocks(PlateStocksArgs), Account { market: Option<String>, security_firm: Option<String>, all: bool, }, Funds(FundsArgs), Position(PositionArgs), Order(OrderArgs), Deal(DealArgs), UnlockTrade { lock: bool, from_stdin: bool, otp: Option<String>, security_firm: Option<SecurityFirmArg>, acc_ids: Vec<u64>, }, SetTradePwd { account: String, from_stdin: bool, }, ClearTradePwd { account: String, }, SetLoginPwd { account: String, from_stdin: bool, }, ClearLoginPwd { account: String, }, Repl, GenKey(GenKeyArgs), BindKey { id: String, keys_file: Option<PathBuf>, this_machine: bool, machines: Option<String>, replace: bool, clear: bool, freeze: bool, }, MachineId { for_key: Option<String>, }, ListKeys { keys_file: Option<PathBuf>, json: bool, }, RevokeKey { id: String, keys_file: Option<PathBuf>, yes: bool, }, PlaceOrder(PlaceOrderArgs), ModifyOrder(ModifyOrderArgs), CancelOrder(CancelOrderArgs), ReconfirmOrder(ReconfirmOrderArgs), HistoryOrders(HistoryOrdersArgs), HistoryDeals(HistoryDealsArgs), MaxQtys(MaxQtysArgs), MarginRatio(MarginRatioArgs), OrderFee(OrderFeeArgs), CapitalFlow { symbol: String, period_type: i32, begin: Option<String>, end: Option<String>, }, CapitalDistribution { symbol: String, }, MarketState { symbols: String, }, OwnerPlate { symbols: String, }, OptionChain {
Show 17 fields owner: Option<String>, owner_arg: Option<String>, begin: String, end: String, option_type: String, delta_min: Option<f64>, delta_max: Option<f64>, iv_min: Option<f64>, iv_max: Option<f64>, oi_min: Option<f64>, oi_max: Option<f64>, gamma_min: Option<f64>, gamma_max: Option<f64>, vega_min: Option<f64>, vega_max: Option<f64>, theta_min: Option<f64>, theta_max: Option<f64>,
}, TradingDays { market: String, begin: String, end: String, }, Rehab { symbol: String, }, Suspend { symbols: Option<String>, symbols_arg: Option<String>, begin: String, end: String, }, UserSecurity { group: Option<String>, group_arg: Option<String>, }, UserSecurityGroups { group_type: i32, }, Warrant { owner: Option<String>, begin: i32, num: i32, }, IpoList { market: String, }, FutureInfo { symbols: String, }, StockFilter { market: String, begin: i32, num: i32, }, CancelAllOrder { acc_id: Option<u64>, card_num: Option<String>, env: String, market: Option<String>, confirm: bool, }, GlobalState, UserInfo, QuoteRights { refresh: bool, }, DelayStatistics, TokenState, RiskFreeRate, SpreadTable, TickerStatistic { symbol_pos: Option<String>, symbol: Option<String>, ticker_type: Option<i32>, stat_type: Option<u32>, }, TickerStatisticDetail { symbol_pos: Option<String>, symbol: Option<String>, ticker_type: Option<i32>, ticker_time: Option<u64>, select_num: Option<u32>, data_from: Option<u32>, data_max_count: Option<u32>, stat_type: Option<u32>, }, QuerySubscription { all_conn: bool, }, UsedQuota, Unsubscribe { symbols: String, sub_types: String, all: bool, }, HistoryKlQuota { detail: bool, }, HoldingChange { symbol: String, category: i32, begin: Option<String>, end: Option<String>, }, ModifyUserSecurity { group: String, op: i32, symbols: String, }, CodeChange { symbols: String, }, SetPriceReminder { symbol: String, op: i32, key: Option<i64>, type: Option<i32>, freq: Option<i32>, value: Option<f64>, note: Option<String>, session: Vec<i32>, }, PriceReminder { symbol: Option<String>, market: Option<i32>, }, OptionExpirationDate { owner: Option<String>, owner_arg: Option<String>, index_type: Option<i32>, }, SubAccPush { acc_ids: String, }, AccCashFlow(AccCashFlowArgs), DaemonStatus { rest_url: Option<String>, rest_port: Option<u16>, api_key: Option<String>, }, DaemonShutdown { rest_url: Option<String>, rest_port: Option<u16>, api_key: Option<String>, }, DaemonReload { rest_url: Option<String>, rest_port: Option<u16>, api_key: Option<String>, }, CashLog(CashLogArgs), CashDetail(CashDetailArgs), BizGroup(BizGroupArgs), MarginInfo(MarginInfoArgs), AccountFlag(AccountFlagArgs), BondTotalAsset(BondTotalAssetArgs), BondSingleAsset(BondSingleAssetArgs), BondPositionList(BondPositionListArgs), BondAnswerState(BondAnswerStateArgs), BondTradeReminder(BondTradeReminderArgs),
}

Variants§

§

Ping

探活:连接网关并测一次 RTT

§

Quote(QuoteArgs)

获取基础实时报价(CLI 自动订阅 SubType::Basic)

§

Snapshot(SnapshotArgs)

获取股票快照(单次,无需订阅)

§

Sub(SubArgs)

订阅行情推送并持续打印(Ctrl-C 停止)

v1.4.83 §10 新增 aliases: subscribe / subscription

§

Kline(KlineArgs)

获取历史 K 线

v1.4.83 §10: --symbol / --code / --stock flag alias 替代 positional

§

Orderbook(OrderbookArgs)

获取摆盘

v1.4.83 §10: --symbol / --code / --stock flag alias 替代 positional

§

Ticker(TickerArgs)

获取逐笔成交

v1.4.83 §10: --symbol / --code / --stock flag alias

§

Rt(RtArgs)

获取分时数据

v1.4.83 §10: --symbol / --code / --stock flag alias

§

Static(StaticArgs)

获取静态信息(名称、每手数量、类型、上市时间等)

§

Broker(BrokerArgs)

获取经纪队列

v1.4.83 §10: --symbol / --code / --stock flag alias

§

PlateList(PlateListArgs)

列出板块集合

§

PlateStocks(PlateStocksArgs)

列出板块内股票

§

Account

列出交易账户(默认显示 App 可见账户集合)

Fields

§market: Option<String>

过滤交易市场:HK | US | CN | … | all。不传时在 App 可见集合内不过滤。

§security_firm: Option<String>

过滤券商:FutuHK | FutuInc/FutuUS | hk | us | 1..7 | all。不传时在 App 可见集合内不过滤。

§all: bool

排障模式:显示 daemon raw discovery 全集,包括 App 不单独展示的内部账户行。

§

Funds(FundsArgs)

查询账户资金

§

Position(PositionArgs)

查询持仓

§

Order(OrderArgs)

查询当日订单

§

Deal(DealArgs)

查询当日成交

§

UnlockTrade

解锁 / 锁定交易(gateway 进程级,重启失效)

密码来源优先级:–from-stdin > FUTU_TRADE_PWD 环境变量 > 交互式 prompt(无回显)。 解锁成功后所有连同一网关的客户端(futucli / futu-mcp / Python)都可下单。

Fields

§lock: bool

锁回交易(清除 gateway 侧 cipher 缓存)

§from_stdin: bool

从 stdin 读一行作为密码(脚本管道友好,覆盖环境变量 / tty prompt)

§otp: Option<String>

OTP / 令牌动态密码明文(v1.4.31+,2FA 用户必填)

若账号开启了“令牌动态密码“二次验证:首次 unlock 会收到 daemon 提示 需要令牌动态密码,再次调用带此参数即可。无 2FA 账号留空。

§security_firm: Option<SecurityFirmArg>

只解锁该券商下的账户。不传则解锁所有 broker(默认,向后兼容)。 对齐 C++ OpenD 的 per-broker unlock 语义。

接受 3 种形式(v1.4.34 验证数字和别名确实能跑;clap 默认报错 消息只列官方名,用 --help 看详细用法):官方名、1-7 数字、短别名。

§acc_ids: Vec<u64>

v1.4.34+ 只解锁指定 acc_id 列表(逗号分隔)。和 --security-firm 同时传时取交集。解决同 broker 内影子账户拖垮主账户的场景—— 显式传主账户 acc_id,影子账户不进请求。

§

SetTradePwd

把交易密码存到 OS keychain(v1.4+)

存完后 futu-mcp 的 futu_unlock_trade 工具可以在 LLM 需要下单时自动 解锁,而不暴露明文密码给 LLM。默认以交互式 tty prompt 读入(无回显), 自动化脚本可用 --from-stdin 从 stdin 读一行。

后端:macOS Keychain / Linux DBus Secret Service / Windows Credential Manager。 每个登录账号一条独立条目(username = trade-password.<account>), 避免多账号互相覆盖。

Fields

§account: String

登录账号(牛牛号 / 手机号 / 邮箱)—— 和 futu-opend –login-account 完全一致

§from_stdin: bool

从 stdin 读一行密码(脚本/CI 友好,不做二次确认)

§

ClearTradePwd

清除 keychain 里某登录账号的交易密码

Fields

§account: String
§

SetLoginPwd

把登录密码写入 OS keychain(v1.4.18+)

存完后 futu-opend 启动时如果没传 --login-pwd / FUTU_PWD,会自动 从 keychain 读该账号的密码。每个账号一条独立条目(username = login-password.<account>),避免多账号互相覆盖。

默认以交互式 tty prompt 读入(无回显,不进 shell history),自动化脚本 可用 --from-stdin 从 stdin 读一行。

Fields

§account: String

账号(牛牛号 / 手机号 / 邮箱)—— 和 futu-opend –login-account 完全一致

§from_stdin: bool

从 stdin 读一行密码(脚本/CI 友好,不做二次确认)

§

ClearLoginPwd

清除 keychain 里某账号的登录密码

Fields

§account: String
§

Repl

进入交互式 REPL(共享一条长连接,历史记录,推送实时显示)

§

GenKey(GenKeyArgs)

生成新的 futu-mcp API Key 并追加到 keys.json

明文 key 只会打印到 stdout 一次;文件中只存 SHA-256 hash。 用法示例: futucli gen-key –id readonly –scopes qot:read,acc:read futucli gen-key –id sim-bot –scopes qot:read,trade:simulate –expires 30d futucli gen-key –id prod –scopes trade:real –allowed-markets HK
–allowed-symbols HK.00700,HK.09988 –max-order-value 50000
–max-daily-value 200000 –hours-window 09:30-16:00 –expires 90d

§

BindKey

就地编辑已有 key 的机器绑定(不重新生成明文)

用法示例: futucli bind-key –id sim-bot –this-machine # 追加本机 futucli bind-key –id sim-bot –machines aabb…,ccdd… # 追加指定指纹 futucli bind-key –id sim-bot –replace –this-machine # 覆盖白名单 futucli bind-key –id sim-bot –clear # 完全解绑 futucli bind-key –id sim-bot –freeze # 临时冻结(allowed_machines = []) 改完记得 SIGHUP 网关:kill -HUP $(pgrep futu-opend)

Fields

§id: String

要编辑的 key id

§keys_file: Option<PathBuf>

keys.json 路径。默认(按 OS):macOS ~/Library/Application Support/futu/keys.json / Linux ~/.config/futu/keys.json / Windows %APPDATA%/futu/keys.json

§this_machine: bool

追加本机指纹

§machines: Option<String>

追加指定指纹,逗号分隔的 64 位 hex

§replace: bool

替换模式:用新指纹覆盖整个白名单(默认是追加)

§clear: bool

清除绑定:把 allowed_machines 置为 None(等同于未启用绑定)

§freeze: bool

冻结:把 allowed_machines 置为 [](任何机器都不过)

§

MachineId

打印本机 machine-id 或指定 key_id 的绑定指纹

--for-key 时打印原始 machine-id(仅用于确认是不是同一台机器)。 加 --for-key <id> 时打印指纹(可复制给签发者,写进该 key 的 allowed_machines)。

Fields

§for_key: Option<String>

要生成指纹的 key id(和签发方的 gen-key --id 保持一致)

§

ListKeys

列出 keys.json 中所有 API Key(不含明文,明文只在 gen-key 时打印一次)

默认输出短表格 (含 ID/STATUS/SCOPES/MARKETS/SYMBOLS/ACCOUNTS/LIMITS/DAILY/WINDOW/BOUND/EXPIRES/NOTE). 加 --json 输出机读 JSON (字段全, 含 hash / created_at / allowed_machines 等).

Fields

§keys_file: Option<PathBuf>

keys.json 路径。默认(按 OS):macOS ~/Library/Application Support/futu/keys.json / Linux ~/.config/futu/keys.json / Windows %APPDATA%/futu/keys.json

§json: bool

v1.4.106 codex 0608 F3 (P2): 输出 JSON 数组而不是短表格

JSON 字段含完整 KeyRecord (hash / created_at / allowed_machines / allowed_acc_ids / allowed_card_nums / allowed_symbols / hours_window 等) 适合脚本 / agent 读取. 空 keys.json 输出 [].

§

RevokeKey

吊销一条 API Key(按 id 从 keys.json 删除;需要运行中的网关 SIGHUP 才生效)

Fields

§id: String

要吊销的 key id

§keys_file: Option<PathBuf>

keys.json 路径。默认(按 OS):macOS ~/Library/Application Support/futu/keys.json / Linux ~/.config/futu/keys.json / Windows %APPDATA%/futu/keys.json

§yes: bool

确认吊销(未加 –yes 时仅 dry-run)

§

PlaceOrder(PlaceOrderArgs)

下单(Python SDK OpenTradeContext.place_order

real env 必须带 --confirm,防复制粘贴 / 回车误触。 建议先在 simulate env 测通再走 real。

Market hours requirement(v1.4.35 加):OpenD 协议层不支持非交易时段预提交订单。 必须在活跃市场时段调用:

  • HK: 周一至五 09:30-16:00 HKT(开盘前 09:00-09:30 可用 --order-type AUCTION
  • US: 周一至五 09:30-16:00 ET(HKT 冬令 22:30-05:00,夏令 21:30-04:00)
  • CN: 周一至五 09:30-11:30 + 13:00-15:00 CST
  • SG: 周一至五 09:00-17:00 SGT
  • JP: 周一至五 09:00-11:30 + 12:30-15:00 JST
  • AU: 周一至五 10:00-16:00 AEST/AEDT
  • CA: 周一至五 09:30-16:00 EST/EDT

非交易时段想使用服务端预提交队列挂单,请用富途牛牛 / moomoo APP; 该队列不和 OpenD 共享。休市时调 place-order 会拿到服务端通用错 + daemon 追加的 [hint] 说明,不要试图换 --order-type 绕过。

§

ModifyOrder(ModifyOrderArgs)

改单 / 撤单 / 启停订单(Python SDK OpenTradeContext.modify_order

§

CancelOrder(CancelOrderArgs)

撤单(modify-order 的常用快捷方式,op=CANCEL)

§

ReconfirmOrder(ReconfirmOrderArgs)

二次确认订单(Python SDK OpenTradeContext.reconfirm_order

§

HistoryOrders(HistoryOrdersArgs)

查询历史订单(Python SDK OpenTradeContext.history_order_list_query

§

HistoryDeals(HistoryDealsArgs)

查询历史成交(Python SDK OpenTradeContext.history_deal_list_query

§

MaxQtys(MaxQtysArgs)

查最大可买/可卖(Python SDK OpenTradeContext.acctradinginfo_query

§

MarginRatio(MarginRatioArgs)

查询融资融券比率(对齐 py-futu-api get_margin_ratio;v1.4.31)

§

OrderFee(OrderFeeArgs)

查询订单费用明细(对齐 py-futu-api order_fee_query;v1.4.31)

§

CapitalFlow

资金流向时间序列

Fields

§symbol: String

证券 MARKET.CODE,如 HK.00700 / US.AAPL

§period_type: i32

周期类型:1=分时 2=1日 3=3日 4=5日 5=10日 6=20日 7=30日 8=60日 9=90日 10=180日 11=360日

§begin: Option<String>

开始时间 YYYY-MM-DD HH:MM:SS(可选)

§end: Option<String>

结束时间(可选)

§

CapitalDistribution

资金分布快照(超大/大/中/小单流入流出)

Fields

§symbol: String
§

MarketState

市场状态查询(开盘/休市/午休)

Fields

§symbols: String

证券列表,逗号分隔,如 HK.00700,US.AAPL

§

OwnerPlate

股票所属板块

Fields

§symbols: String

证券列表,逗号分隔

§

OptionChain

期权链(按到期日列出 call/put 合约)

Fields

§owner: Option<String>

正股 MARKET.CODE,如 HK.00700 / US.AAPL(位置参数或 –owner / –code 二选一)

§owner_arg: Option<String>

v1.4.52 BUG-9: REST/MCP 风格命名参数 alias

§begin: String

到期日范围开始 YYYY-MM-DD

§end: String

到期日范围结束 YYYY-MM-DD

§option_type: String

期权类型:all|call|put(默认 all)

§delta_min: Option<f64>

Greek filter: delta 下限

§delta_max: Option<f64>

Greek filter: delta 上限

§iv_min: Option<f64>

Greek filter: implied volatility 下限(小数,如 0.3 = 30%)

§iv_max: Option<f64>

Greek filter: implied volatility 上限(小数,如 0.3 = 30%)

§oi_min: Option<f64>

Greek filter: open interest 下限

§oi_max: Option<f64>

Greek filter: open interest 上限

§gamma_min: Option<f64>

Greek filter: gamma 下限

§gamma_max: Option<f64>

Greek filter: gamma 上限

§vega_min: Option<f64>

Greek filter: vega 下限

§vega_max: Option<f64>

Greek filter: vega 上限

§theta_min: Option<f64>

Greek filter: theta 下限

§theta_max: Option<f64>

Greek filter: theta 上限

§

TradingDays

交易日列表(对齐 py-futu-api request_trading_days

Fields

§market: String

市场:HK / US / CN / NT / ST / JP / SG

§begin: String

起始日期 YYYY-MM-DD

§end: String

结束日期 YYYY-MM-DD

§

Rehab

复权因子(对齐 py-futu-api get_rehab;长期 K 线对齐 / 回测必用)

Fields

§symbol: String

证券 MARKET.CODE,如 HK.00700 / US.AAPL

§

Suspend

停牌日查询(对齐 py-futu-api get_suspend

Fields

§symbols: Option<String>

证券列表,逗号分隔(位置参数或 –code / –symbols 二选一)

§symbols_arg: Option<String>

v1.4.52 BUG-9: REST/MCP 风格命名参数 alias

§begin: String

起始日期 YYYY-MM-DD

§end: String

结束日期 YYYY-MM-DD

§

UserSecurity

自选股分组下的股票(对齐 py-futu-api get_user_security

Fields

§group: Option<String>

分组名(位置参数或 –group 二选一,用 user-security-groups 先看可用分组)

§group_arg: Option<String>

v1.4.52 BUG-9: REST/MCP 风格命名参数 alias

§

UserSecurityGroups

自选股分组列表(对齐 py-futu-api get_user_security_group

Fields

§group_type: i32

分组类型:1=自定义 / 2=系统 / 3=全部(默认 3)

§

Warrant

涡轮列表(对齐 py-futu-api get_warrant;按成交量降序)

Fields

§owner: Option<String>

可选正股 MARKET.CODE(不传则全市场)

§begin: i32

分页起始 index (默认 0). v1.4.106 codex 0635 ζ36 F1: 暴露分页参数, 拿下一页用 --begin 20 --num 20 (响应含 last_page / all_count)

§num: i32

最大行数(1-200,默认 20)

§

IpoList

新股 IPO 列表(对齐 py-futu-api get_ipo_list

Fields

§market: String

市场:HK / US / CN

§

FutureInfo

期货合约资料(对齐 py-futu-api get_future_info

Fields

§symbols: String

期货代码列表,逗号分隔(如 HK.HSImain / US.MNQmain)

§

StockFilter

条件选股最小版(对齐 py-futu-api get_stock_filter;高级过滤走 REST)

Fields

§market: String

市场:HK / US / CN

§begin: i32

分页起始(默认 0)

§num: i32

返回行数(1-200,默认 50)

§

CancelAllOrder

全部撤单(对齐 py-futu-api cancel_all_order

⚠️ 风险:立即撤该账户指定市场(不传 –market 则全账户)所有 pending 订单,不可恢复。real env 必须 --confirm

Fields

§acc_id: Option<u64>

账户 id;也可改用 –card-num 传 App 显示卡号

§card_num: Option<String>

App 显示卡号:4 位末尾或 16 位完整卡号

§env: String

环境:simulate(默认)/ real

§market: Option<String>

市场:HK / US / HKCC / CN(可选,不传则全账户)

§confirm: bool

real 环境必须带此 flag 确认(防误触)

§

GlobalState

网关全局状态(市场开闭 / 服务器版本 / 登录状态)

§

UserInfo

用户信息(昵称 / 各市场行情权限 / 订阅配额 / 历史 K 线配额)

§

QuoteRights

行情权限概览(C++ OpenD GUI 风格分组;可选刷新最高行情权限)

Fields

§refresh: bool

查询前先触发 request_highest_quote_right 刷新

§

DelayStatistics

延迟统计(行情推送 / 请求 / 下单三类延迟分布概要)

§

TokenState

v1.4.98 T2-8: NN+MM token 启用/绑定状态查询. unlock-trade -20011 时 第一线诊断 (NN=Futu Token app, MM=moomoo Token app, 同协议异 app brand). 输出 4 字段: nn/mm × enable/bind (1=已启用/绑定, 0=未启用/未绑定).

§

RiskFreeRate

v1.4.98 T2-2: 无风险利率 (HK/US/JP, 期权定价基准). backend cmd 20231. 输出 3 市场利率 (百分比 + raw uint64) + update_time.

§

SpreadTable

v1.4.98 T2-1: 摆盘步长 (价位表) — backend cmd 6503. PlaceOrder/ModifyOrder 校验价格合法性必备.

§

TickerStatistic

v1.4.98 T2-3: 逐笔统计 (avg_price / 主买/主卖/中性量等) — cmd 6365. 前置: symbol 必须先 subscribe / get_static_info 触发 stock_id 缓存.

v1.4.102 A3 alias: 加 positional [SYMBOL] 短写, 跟其他行情类 command (quote / snapshot / kline) 一致. futucli ticker-statistic HK.00700 等同 --symbol HK.00700.

Fields

§symbol_pos: Option<String>

证券 symbol (e.g. HK.00700, US.AAPL) — 位置参数或 –symbol 二选一

§symbol: Option<String>

证券 symbol (named arg form, 兼容老用法)

§ticker_type: Option<i32>

逐笔类型 0=ALL, 1=BUY, 2=SELL, 3=BUY_AND_SELL, 4=NEUTRAL

§stat_type: Option<u32>

市场状态 0=ALL, 1=BEFORE, 2=TRADING, 3=AFTER

§

TickerStatisticDetail

v1.4.106 codex 0500 ζ23-redo: 逐笔统计 Detail (价位级分布) — cmd 6366. 配套 ticker-statistic (Info, cmd 6365): 先调 Info 拿 ticker_time, 再调 Detail 同 ticker_time 拿这个时点的 DetailItem 列表 (price / buy_volume / sell_volume / volume / ratio / neutral_volume). 前置: symbol 必须先 subscribe / get_static_info 触发 stock_id 缓存.

Fields

§symbol_pos: Option<String>

证券 symbol (e.g. HK.00700, US.AAPL) — 位置参数或 –symbol 二选一

§symbol: Option<String>

证券 symbol (named arg form, 兼容老用法)

§ticker_type: Option<i32>

逐笔类型 0=ALL, 1=BUY, 2=SELL, 3=BUY_AND_SELL, 4=NEUTRAL

§ticker_time: Option<u64>

时间戳 (ms) — 通常从前一次 ticker-statistic call 拿到. 0/省略 = backend 默认

§select_num: Option<u32>

筛选 0=全部价位 / 1..N=top N 价位 (backend max ~100)

§data_from: Option<u32>

分页 起始项 (默认 0)

§data_max_count: Option<u32>

分页 size 单页最大 (默认 20)

§stat_type: Option<u32>

市场状态 0=ALL, 1=BEFORE, 2=TRADING, 3=AFTER

§

QuerySubscription

查询当前订阅状态(已用 / 剩余额度 + 订阅清单)

Fields

§all_conn: bool

是否查询所有连接(默认只查本连接)

§

UsedQuota

查询当前 daemon 已用订阅额度与历史 K 线额度

§

Unsubscribe

反订阅行情数据(也可 –all 清空本连接所有订阅)

Fields

§symbols: String

证券列表,逗号分隔(–all 时忽略)

§sub_types: String

订阅类型 id 列表,逗号分隔(proto Qot_Common.SubType: 1=Basic 2=OrderBook 4=Ticker 5=RT 6=KL_Day 7=KL_5Min 8=KL_15Min 9=KL_30Min 10=KL_60Min 11=KL_1Min 12=KL_Week 13=KL_Month 14=Broker 15=KL_Quarter 16=KL_Year 17=KL_3Min, 跳 3=None)

§all: bool

清空本连接所有订阅

§

HistoryKlQuota

历史 K 线下载配额

Fields

§detail: bool

是否返回每只股票的下载详情(默认 false)

§

HoldingChange

持股变动(高管 / 机构 / 基金)

Fields

§symbol: String

证券 MARKET.CODE

§category: i32

持有者类别:1=机构 / 2=基金 / 3=高管

§begin: Option<String>

开始时间 YYYY-MM-DD HH:MM:SS(可选)

§end: Option<String>

结束时间(可选)

§

ModifyUserSecurity

修改自选股分组(add / del / move_out)

Fields

§group: String

分组名

§op: i32

操作:1=AddInto / 2=Delete / 3=MoveOut

§symbols: String

证券列表,逗号分隔

§

CodeChange

股票代码变更 / 临时代码信息(目前仅港股)

Fields

§symbols: String

证券列表,逗号分隔

§

SetPriceReminder

设置到价提醒

Fields

§symbol: String

证券 MARKET.CODE

§op: i32

操作:1=Add / 2=Del / 3=Enable / 4=Disable / 5=Modify / 6=DelAll

§key: Option<i64>

提醒 key(modify/del/enable/disable 时必填)

§type: Option<i32>

提醒类型 (1=PriceUp 2=PriceDown 3=ChangeRateUp 4=ChangeRateDown 5=5MinChangeRateUp 6=5MinChangeRateDown 7=VolumeUp 8=TurnoverUp 9=TurnoverRateUp 10=BidPriceUp 11=AskPriceDown 12=BidVolUp 13=AskVolUp 14=3MinChangeRateUp 15=3MinChangeRateDown — 见 Qot_Common.PriceReminderType)

§freq: Option<i32>

频率(1=Always 2=OncePerDay 3=Once)

§value: Option<f64>

阈值(add/modify 必填)

§note: Option<String>

备注 (最多 40 半角字节 / 20 中文字符, 对齐 C++ NoteMaxLen)

§session: Vec<i32>

v1.4.106 codex 1116 F4 [P2]: reminder session list, 逗号分隔. (1=Open 2=USPre 3=USAfter 4=USOverNight) 美股 + 留空 → daemon 默认补 [Open, USPre, USAfter] (对齐 C++).

§

PriceReminder

查询到价提醒(按 symbol 或 market)

Fields

§symbol: Option<String>

证券(和 –market 二选一)

§market: Option<i32>

市场 code(Qot_Common::QotMarket,和 –symbol 二选一)

§

OptionExpirationDate

期权到期日列表

Fields

§owner: Option<String>

标的股 MARKET.CODE(位置参数或 –owner 二选一)

§owner_arg: Option<String>

v1.4.52 BUG-9: REST/MCP 风格命名参数 alias

§index_type: Option<i32>

指数期权类型(仅恒指/国指)

§

SubAccPush

订阅账户推送(订单 / 成交)

Fields

§acc_ids: String

账户 id 列表,逗号分隔

§

AccCashFlow(AccCashFlowArgs)

账户资金流水(对齐 get_acc_cash_flow

§

DaemonStatus

v1.4.32+ daemon 健康状态快照(GET /api/admin/status)。 同事提议的“快速看 daemon 在线不、broker 通不通、解锁没“工具。 scope 模式下 key 必须持 admin scope,否则被 bearer_auth 拒。

Fields

§rest_url: Option<String>

目标 REST 端口 URL(默认从 FUTU_REST_URL 环境变量读,或 http://127.0.0.1:22222)

§rest_port: Option<u16>

v1.4.52 BUG-9: REST/MCP 风格用户习惯指定 port,自动转 http://127.0.0.1:

§api_key: Option<String>

带 Bearer Token(scope 模式下需要 admin scope 的 key)

§

DaemonShutdown

v1.4.32+ 优雅退出 daemon(POST /api/admin/shutdown)。 daemon 响应 200 后 1 秒 std::process::exit(0)。是否重启由进程 supervisor(systemd / Docker)决定。

Fields

§rest_url: Option<String>

目标 REST 端点 URL(默认从 FUTU_REST_URL 环境变量读,或 http://127.0.0.1:22222)

§rest_port: Option<u16>

v1.4.106 codex 0554 F5 [P3]: 风格一致性 — 与 daemon-status 对齐, REST/MCP 风格用户习惯指定 port, 自动转 http://127.0.0.1:.

§api_key: Option<String>

带 Bearer Token(scope 模式下需要 admin scope 的 key)

§

DaemonReload

v1.4.32+ 重置 trade cipher 缓存(POST /api/admin/reload)。 用于“解锁状态错乱 / 换了交易密码“场景——清空 cipher 缓存后客户端 必须重新 unlock-trade。不重启 daemon 进程,不影响 Platform / broker TCP 连接。

Fields

§rest_url: Option<String>

目标 REST 端点 URL(默认从 FUTU_REST_URL 环境变量读,或 http://127.0.0.1:22222)

§rest_port: Option<u16>

v1.4.106 codex 0554 F5 [P3]: 风格一致性 — 与 daemon-status 对齐, REST/MCP 风格用户习惯指定 port, 自动转 http://127.0.0.1:.

§api_key: Option<String>

带 Bearer Token(scope 模式下需要 admin scope 的 key)

§

CashLog(CashLogArgs)

资金明细查询 (mobile-driven, 比 acc-cash-flow 字段更全) — v1.4.94 M1

v1.4.102 A3 alias: positional [ACC_ID] 短写 (futucli cash-log 12345 --begin-time ... 等同 --acc-id 12345).

§

CashDetail(CashDetailArgs)

单条资金流水详情 — v1.4.94 M1 + v1.4.102 A3 positional alias

§

BizGroup(BizGroupArgs)

业务分类元数据 — v1.4.94 M1 + v1.4.102 A3 positional alias

§

MarginInfo(MarginInfoArgs)

per-account margin info (HK / US / CN_AH) — v1.4.95 U2-D

margin-ratio (per-security ratio) 互补: 本命令给账户全景 (购买力 / 杠杆 / 风险等级 / 流动性 / HK-specific 港股保证金).

§

AccountFlag(AccountFlagArgs)

账户合规标志查询 — v1.4.95 U2-A

高级交易准入 (期权 / 衍生品 / OTC / CFD 等) 强制要求. 常用 flag_id: 5=US 期权确认, 22=衍生品风批 (合并新), 10=基金 KYC, 16=PDT 风披, 23=美股 OTC. 详见 proto 头部完整 36+ 项列表.

§

BondTotalAsset(BondTotalAssetArgs)

账户债券总持仓 (P&L 汇总) — v1.4.95 U2-B

§

BondSingleAsset(BondSingleAssetArgs)

单只债券持仓 (含派息/到期/通知) — v1.4.95 U2-B

§

BondPositionList(BondPositionListArgs)

账户债券持仓列表 — v1.4.95 U2-B

§

BondAnswerState(BondAnswerStateArgs)

是否需要答题 (suitability questionnaire) — v1.4.95 U2-B

§

BondTradeReminder(BondTradeReminderArgs)

交易提醒 (是否可买/复杂/高风险/可卖/资格预审) — v1.4.95 U2-B

Trait Implementations§

Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more