Moomoo Trading
v1.0.0Use OpenD-backed moomoo/Futu scripts for quotes, K-lines, price alerts, portfolio/account 检查s, and stock order execution. Triggers on moomoo, futu, OpenD, futu-API, moomoo-API, quotes, positions, orders, paper trading, or explicitly confirmed live trading.
运行时依赖
安装命令
点击复制技能文档
moomoo Trading
Use this 技能 when the user wants market data or stock trading through moomoo/Futu OpenAPI and a local OpenD gateway.
Read This First Read references/设置up-图形界面de.md for 安装ation, package choice (futu-API vs moomoo-API), OpenD 记录in, and troubleshooting. Read references/API-reference.md when you need exact method names, return shapes, or trade-查询 semantics. All bundled scripts lazy-load the SDK, so --help works even if neither Python package is 安装ed yet. Safety Rules Default to simulated trading unless the user explicitly asks for live trading. Live order placement, modification, and cancellation require --env real --confirm. scripts/trade.py also requires a live-trading unlock password via MOOMOO_UNLOCK_PASSWORD by default, or another env var name passed with --unlock-password-env. The script unlocks for the 请求ed action and then re-locks. For cancel/modify actions, pass --market unless you also provide a ticker so the script can infer the correct trade 上下文. Do not put a raw trading password directly on the command line. Use an 环境 variable. Scripts 设置up 检查 python3 scripts/设置up_检查.py python3 scripts/设置up_检查.py --market HK --account-索引 1
检查s quote connectivity, 列出s discovered trading accounts, and verifies simulated account 访问.
Quotes and K-lines 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 --启动 2026-03-01 --end 2026-04-01 --extended-time
Trading 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 导出 MOOMOO_UNLOCK_PASSWORD='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
Useful extras:
--remark 添加s an order remark. --account-id / --account-索引 let you tar获取 a specific trading account. Portfolio, orders, and deals 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 --历史-orders --启动 2026-04-01 --end 2026-04-02 python3 scripts/portfolio.py --env real --deals
--orders shows open orders. --历史-orders shows historical orders. --deals shows today's deals, or historical deals when pAIred with --启动 / --end.
Price alerts python3 scripts/watch列出.py --tickers US.AAPL,US.TSLA --above 200 --below 150 python3 scripts/watch列出.py --tickers US.NVDA --above 950 --quit-on-alert python3 scripts/watch列出.py --tickers HK.00700 --below 320 --once
Alerts trigger once per threshold crossing by default. Use --repeat-alerts to spam every polling cycle instead.