Use Futu Trade Bot Skills to run account, quote, and trade workflows with real HK market data.
Data & analysis
OpenD CLI for MooMoo
Agentic trading and market-data workflows for Futu OpenD (MooMoo/Futu OpenAPI), including OpenClaw-compatible secret-ref credential loading, account discover...
What it does
Agentic trading and market-data workflows for Futu OpenD (MooMoo/Futu OpenAPI), including OpenClaw-compatible secret-ref credential loading, account discover...
The skill document
OpenD Skill
Use this skill to execute local OpenD operations through a single CLI surface.
Quick Start
- Ensure OpenD is running on
127.0.0.1:11111, or override withOPEND_HOSTandOPEND_PORT. - Install one provider SDK:
moomooorfutu. - Prefer OpenClaw-managed secret refs for hosted use:
export OPEND_PASSWORD_SECRET_REF='{"source":"env","id":"MOOMOO_PASSWORD"}'- Provide the actual
MOOMOO_PASSWORDthrough OpenClaw gateway secret injection, not plain shell export.
- Optional local-only helpers:
pip install keyring cryptography.
Primary Interface
Use Bash CLI ./openclaw for routine operations. If the wrapper is unavailable in a published bundle, use python3 opend_cli.py directly and treat that as a packaging bug.
Examples:
- Snapshot:
./openclaw snapshot --codes HK.00700,US.AAPL
- Accounts:
./openclaw accounts
- Positions:
./openclaw --trd-env SIMULATE positions
- Place simulated order:
./openclaw --market HK --trd-env SIMULATE place-order --code HK.00700 --price 100 --qty 100 --side BUY
- Cancel order:
./openclaw --market HK --trd-env SIMULATE cancel-order --order-id
Credential Methods
- Default:
openclaw- Reads
OPEND_PASSWORD_SECRET_REFfirst. - Current local resolver accepts OpenClaw-style env refs only:
{"source":"env","id":"ENV_VAR_NAME"}. fileandexecrefs must be resolved by the OpenClaw gateway before launching this skill.
- Reads
- Legacy compatibility:
env: readsMOOMOO_PASSWORDconfig: readsMOOMOO_CONFIG_KEYand decryptsconfig.enckeyring: prompts once and stores password in the OS keyring
- Deliberate warning:
env,config, andkeyringbypass the preferred OpenClaw secret-ref audit path. Use them only for local development or controlled offline workflows.
Agentic Defaults
- Prefer
--output jsonso downstream steps can parse results. - Prefer
SIMULATEunless the user explicitly requests live trading. - Query
accountsfirst for unknown environments, then pass explicit--acc-id. - For live trading, unlock is required. Simulated accounts skip unlock automatically.
Safety and Secret Handling
- This repository is an open-source wrapper around a commercial trading API provider. Users are expected to inspect and modify it as needed.
- Hosted or shared deployments should use OpenClaw secret management, not raw shell environment variables.
setup_config.pyandconfig.encare legacy compatibility helpers. They no longer print reusable keys to stdout, but they still create local secret material and should be treated as sensitive.keyringstores credentials in the OS keychain. Confirm that storage model is acceptable before using it.OPEND_SDK_PATHchanges where Python importsmoomooorfutufrom. Only point it at trusted code.
Environment and Runtime Inputs
Secrets:
OPEND_PASSWORD_SECRET_REFMOOMOO_PASSWORDMOOMOO_CONFIG_KEY
Non-secret overrides:
OPEND_HOSTOPEND_PORTOPEND_MARKETOPEND_SECURITY_FIRMOPEND_TRD_ENVOPEND_CREDENTIAL_METHODOPEND_OUTPUTOPEND_SDK_PATH
Files
openclaw: Bash CLI entrypoint.opend_cli.py: structured command interface.opend_core.py: shared OpenD logic.credentials.py: secret-ref, env, keyring, and config password loading.references/api_docs.md: official API links and key limits.references/release_checklist.md: pre-publish validation checklist.
Legacy Compatibility
Older scripts delegate to opend_cli.py:
get_market_snapshot.pyquery_positions.pyplace_order.pyplace_order_env.pyplace_order_keyring.pyplace_order_config.py
Related skills
复星财富(Fosun Wealth)港美股 OpenAPI 交易总入口 skill:统一管理共享凭证 `fosun.env`(生成/修复/备份恢复),并在实盘与模拟盘间路由执行账户、资金、持仓、流水、行情、下单/撤单/改单等能力;全局单凭证 `FOSUN_ENV_PATH`,变更操作强制二次确认并遵循单步执行。
Route OpenClaw CLI requests to the right command family and profile, then verify the outcome.
Use when OpenClaw needs to access AICFO through one bearer API key. Covers agent-session introspection, company selection, app-level MCP usage, connector act...
Create markets, trade, and settle on CLAWLOGIC using npm/npx CLI
Use when the user needs Tonghuashun iFinD market, report, factor, screening, calendar, or other financial data, and all data must come from iFinD after succe...