返回顶部
m

moomoo-trading富途交易脚本

Use OpenD-backed moomoo/Futu scripts for quotes, K-lines, price alerts, portfolio/account checks, and stock order execution. Triggers on moomoo, futu, OpenD, futu-api, moomoo-api, quotes, positions, orders, paper trading, or explicitly confirmed live trading.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
74
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

moomoo-trading

moomoo 交易

当用户需要通过moomoo/富途OpenAPI及本地OpenD网关获取市场数据或进行股票交易时,使用此技能。

请先阅读

  • - 阅读 references/setup-guide.md 了解安装、包选择(futu-api 与 moomoo-api)、OpenD登录及故障排除。
  • 当需要确切的函数名、返回结构或交易查询语义时,请阅读 references/api-reference.md
  • 所有捆绑脚本均采用延迟加载SDK的方式,因此即使尚未安装任何Python包,--help 也能正常工作。

安全规则

  • - 默认使用模拟交易,除非用户明确要求实盘交易。
  • 实盘下单、修改和撤单需要 --env real --confirm。
  • scripts/trade.py 默认还需要通过 MOOMOOUNLOCKPASSWORD 提供实盘交易解锁密码,或通过 --unlock-password-env 传入其他环境变量名称。脚本会在执行请求的操作后解锁并重新锁定。
  • 对于撤单/修改操作,请传递 --market,除非同时提供股票代码以便脚本推断正确的交易上下文。
  • 请勿将原始交易密码直接放在命令行中。请使用环境变量。

脚本

设置检查

bash
python3 scripts/setup_check.py
python3 scripts/setup_check.py --market HK --account-index 1

检查行情连接,列出已发现的交易账户,并验证模拟账户访问权限。

行情与K线

bash
python3 scripts/quote.py US.AAPL HK.00700
python3 scripts/quote.py US.TSLA --snapshot
python3 scripts/quote.py US.NVDA --kline --ktype K_DAY --count 10
python3 scripts/quote.py US.NVDA --kline --start 2026-03-01 --end 2026-04-01 --extended-time

交易

bash
python3 scripts/trade.py --ticker US.AAPL --action buy --qty 10 --price 150 --type limit --env sim
python3 scripts/trade.py --ticker US.AAPL --action sell --qty 5 --type market --env sim
export MOOMOOUNLOCKPASSWORD=your-trading-password
python3 scripts/trade.py --ticker US.AAPL --action buy --qty 10 --type market --env real --confirm
python3 scripts/trade.py --cancel --order-id 12345 --market US --env sim
python3 scripts/trade.py --modify --order-id 12345 --market US --price 155 --qty 10 --env sim

实用附加选项:

  • - --remark 添加订单备注。
  • --account-id / --account-index 可指定特定交易账户。

投资组合、订单与成交

bash
python3 scripts/portfolio.py --env sim
python3 scripts/portfolio.py --env sim --account
python3 scripts/portfolio.py --env sim --orders
python3 scripts/portfolio.py --env real --history-orders --start 2026-04-01 --end 2026-04-02
python3 scripts/portfolio.py --env real --deals

--orders 显示未结订单。--history-orders 显示历史订单。--deals 显示今日成交,或与 --start / --end 配合使用时显示历史成交。

价格提醒

bash
python3 scripts/watchlist.py --tickers US.AAPL,US.TSLA --above 200 --below 150
python3 scripts/watchlist.py --tickers US.NVDA --above 950 --quit-on-alert
python3 scripts/watchlist.py --tickers HK.00700 --below 320 --once

默认情况下,每个阈值触发一次提醒。使用 --repeat-alerts 可在每个轮询周期重复触发提醒。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 moomoo-trading-1775874496 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 moomoo-trading-1775874496 技能

通过命令行安装

skillhub install moomoo-trading-1775874496

下载

⬇ 下载 moomoo-trading v1.0.0(免费)

文件大小: 17.71 KB | 发布时间: 2026-4-12 10:38

v1.0.0 最新 2026-4-12 10:38
Initial release of moomoo-trading.

- Provides scripts for quotes, K-lines, price alerts, portfolio/account checks, and stock order execution using moomoo/Futu OpenAPI with OpenD.
- Supports both simulated and live trading, with safety requirements for live trading (confirmation flag and password unlock).
- Includes setup check, market data, trading, portfolio, and watchlist scripts with extensive command-line options.
- Default behavior is simulated trading unless live trading is explicitly confirmed.
- Comprehensive documentation with code examples and safety guidelines.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部