Skip to content
Skillv1.0.0

futu

Futu / moomoo (富途/moomoo) — HK/US/A-share/SG stocks via a LOCAL OpenD gateway. Account, positions, orders, quotes, history, order placement. Use when the user wants to check or trade a Futu / moomoo /

by starchild-ai-agent(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from starchild-ai-agent/official-skills (futu/SKILL.md). Install upstream with npx skills add starchild-ai-agent/official-skills --skill futu. Copyright stays with the author.

What this is — read this first

🖥️ Local-gateway broker. Futu does not expose a public cloud API. Instead you run a gateway program called OpenD on a machine, log into it with your Futu account, and this CLI talks to OpenD over a local socket (default 127.0.0.1:11111). Your Futu credentials live inside OpenD — they never reach this skill.

⚠️ This means it will NOT work from the Starchild container by default, because OpenD runs on your computer, and the container's 127.0.0.1 is the container itself (a different machine). Two ways to use it:

  1. Run locally — run OpenD + this script on your own computer where OpenD is logged in. (simplest)
  2. Bridge the network — run OpenD on a host the container can reach, then set FUTU_HOST/FUTU_PORT to point at it (you handle the network/firewall/security yourself — exposing OpenD beyond localhost is risky; bind it tightly).

If status reports the gateway is not reachable, this is why.

Set up OpenD (one time)

  1. Download OpenD for your OS from the Futu OpenAPI page (富途牛牛 / moomoo → OpenAPI). It comes as a GUI app and a command-line build.
  2. You need a funded/opened Futu or moomoo account with OpenAPI permission enabled (apply in-app if needed).
  3. Launch OpenD and log in with your Futu credentials (+ phone/2FA). Confirm the API port it listens on (default 11111).
  4. Keep OpenD running while you use this skill. For paper trading, make sure your account has a 模拟 / paper (SIMULATE) sub-account.

Configure (.env)

No secret keys here — only gateway location + (for live) the trade-password MD5. Request via secure input.

Variable Required Notes
FUTU_HOST no OpenD host, default 127.0.0.1
FUTU_PORT no OpenD port, default 11111
FUTU_TRD_MARKET no trade market filter: HK (default) / US / CN / SG
FUTU_SECURITY_FIRM no FUTUSECURITIES (default), FUTUINC, FUTUSG
FUTU_ACC_ID no pin a specific account id; 0 = auto-resolve by environment
FUTU_TRADE_PWD_MD5 live only MD5 of your Futu trade password (needed to unlock live orders)

Paper vs live is resolved from each account's trd_env (SIMULATE = paper, REAL = live); --profile picks which one and the CLI fails closed if it can't find a matching account.

Usage

pip install futu-api (first run). JSON output. Default profile paper.

python skills/futu/scripts/futu_cli.py status                 # checks OpenD reachability + resolves account
python skills/futu/scripts/futu_cli.py account
python skills/futu/scripts/futu_cli.py positions
python skills/futu/scripts/futu_cli.py orders [--executions]
python skills/futu/scripts/futu_cli.py quote --symbol HK.00700
python skills/futu/scripts/futu_cli.py history --symbol US.AAPL --period 1d --limit 90
# place (paper SIMULATE): qty in whole shares; market or limit
python skills/futu/scripts/futu_cli.py place --symbol HK.00700 --side buy --qty 100 --type limit --limit-price 350
python skills/futu/scripts/futu_cli.py cancel --order-id <id>
# live (REAL): needs FUTU_TRADE_PWD_MD5 in .env AND --confirm-live
python skills/futu/scripts/futu_cli.py --profile live --confirm-live place --symbol HK.00700 --side buy --qty 100

Symbol format is mandatory: <MARKET>.<code>HK.00700, US.AAPL, SH.600519, SZ.000001. Periods: 1m 5m 15m 30m 1h 1d 1w 1M.

Gotchas

  • "OpenD gateway not reachable" = OpenD isn't running, not logged in, on a different machine, or a wrong host/port. Re-read the "What this is" section.
  • Futu requires whole-share --qty; no notional orders.
  • Live orders need FUTU_TRADE_PWD_MD5 (the MD5 hash of your trade password, not the password itself). The CLI unlocks the trade context only for live; paper is never unlocked.
  • HK/A-share board lots apply — odd-lot quantities may be rejected by the exchange.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/starchild-ai-agent-official-skills-futu/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

starchild-ai-agent-official-skills-futu.ocm.jsonjson
{
  "ocm": "1",
  "id": "starchild-ai-agent-official-skills-futu",
  "kind": "skill",
  "name": "futu",
  "description": "Futu / moomoo (富途/moomoo) — HK/US/A-share/SG stocks via a LOCAL OpenD gateway. Account, positions, orders, quotes, history, order placement. Use when the user wants to check or trade a Futu / moomoo / 富途 account (e.g. \"Futu positions\", \"buy 100 HK.00700 on moomoo\", \"富途 账户资产\"). Requires a running OpenD gateway — NOT a cloud key.",
  "publisher": "starchild-ai-agent",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "futu",
      "moomoo",
      "opend",
      "broker",
      "hk-stocks",
      "us-stocks",
      "trading",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Futu / moomoo (富途/moomoo) — HK/US/A-share/SG stocks via a LOCAL OpenD gateway. Account, positions, orders, quotes, history, order placement. Use when the user wants to check or trade a Futu / moomoo / 富途 account (e.g. \"Futu positions\", \"buy 100 HK.00700 on moomoo\", \"富途 账户资产\"). Requires a running OpenD gateway — NOT a cloud key."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/starchild-ai-agent/official-skills",
      "path": "futu/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/starchild-ai-agent/official-skills/blob/HEAD/futu/SKILL.md",
      "key": "starchild-ai-agent/official-skills/futu/SKILL.md"
    }
  },
  "instructions": "## What this is — read this first\n\n🖥️ **Local-gateway broker.** Futu does **not** expose a public cloud API. Instead you run a gateway program called **OpenD** on a machine, log into it with your Futu account, and this CLI talks to OpenD over a local socket (default `127.0.0.1:11111`). Your Futu credentials live inside OpenD — they never reach this skill.\n\n**⚠️ This means it will NOT work from the Starchild container by default**, because OpenD runs on *your* computer, and the container's `127.0.0.1` is the container itself (a different machine). Two ways to use it:\n\n1. **Run locally** — run O",
  "cost": {
    "context_tokens": 986
  }
}

Fetch it by URL: GET /api/v1/registry/starchild-ai-agent-official-skills-futu/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.