Token导航 LogoToken导航

Agent Skill · 开发

futu-trading-bot(富途交易机器人)

futu-trading-bot 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

futu-trading-bot 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为需要联网;许可证为 MIT-0,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 2,198。

总安装 19,592周安装 833GitHub Stars 1下载 6,864核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.7

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:futu-trading-bot(富途交易机器人)
来源仓库:https://github.com/jeffersonling1217-png/futu-trading-bot
安装命令:
openclaw skills install futu-trading-bot
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install futu-trading-bot

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

使用Futu Trade Bot Skills通过真实的香港市场数据运行账户、报价和交易工作流程。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install futu-trading-bot;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

futu-trading-bot 怎么安装?

在终端执行 openclaw skills install futu-trading-bot。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

futu-trading-bot 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

futu-trading-bot 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

futu-trading-bot 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

futu-trading-bot 用的人多吗?

公开数据是累计安装 19,592 次,近一周安装 833 次,下载 6,864 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

futu-trading-bot 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
futu-trading-bot

富途交易机器人 · 本页

19,5921需要联网MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
futu-trading-bot
description
Use Futu Trade Bot Skills to run account, quote, and trade workflows with real HK market data.
license
MIT-0
metadata
openclaw
emoji
📈
requires
bins
["python3", "pip"]

Futu Trade Bot Skills 📈

🎯 Overview / 概述

English Version: A trading bot skill based on Futu OpenAPI that enables natural language trading. This skill encapsulates Futu's market quote and order execution APIs, allowing agents to perform real-time trading operations through simple commands or scripts. Perfect for implementing natural language trading strategies and automated workflows.

Important: Always use the encapsulated functions provided in this skill (e.g., submit_order, get_market_snapshot). Never call Futu SDK functions directly (ctx.place_order, ctx.get_market_snapshot), as this will bypass connection management, parameter validation, and error handling, leading to unpredictable failures and resource leaks.

中文版本: 基于富途牛牛API接口的交易机器人技能,帮助用户用自然语言进行交易。本技能已将富途牛牛的行情报价、下单交易等功能做了完整封装,可供智能助手随时调用。建议通过命令行或脚本来实现自然语言的策略生成和交易执行。

重要提示:请始终使用本技能提供的封装函数(如 submit_order、get_market_snapshot)。切勿直接调用富途SDK的原始函数(例如 ctx.place_order),否则会绕过连接管理、参数校验和错误处理,导致不可预料的失败和资源泄漏。


When to Use This Skill / 使用场景

Use this skill when the user asks in natural language, for example:

  • 账户相关:“查一下我的账户余额”、“解锁交易”、“锁定账户”、“看看我有哪些账户”
  • 行情查询:“腾讯现在多少钱?”、“查一下港交所的实时报价”、“帮我看看美团今天的K线图”
  • 数据拉取:“获取腾讯的历史K线数据”、“拉取最近10笔成交”
  • 订阅与回调:“实时监控腾讯的报价”、“给我推送腾讯的逐笔成交”
  • 下单交易:“帮我买100股腾讯,限价350”、“卖出200股阿里”、“撤单”、“把订单价格改到355”
  • 策略运行:

- “帮我写一个区间策略,监控腾讯,低于540买入,高于550卖出” - “启动这个策略” - “我的策略跑得怎么样了?” - “停止我的策略”

Note to agent: When the user expresses any of these intents, you should use the encapsulated functions provided in this skill (e.g., get_account_info, get_market_snapshot, submit_order, etc.). Never call Futu SDK functions directly – always go through the skill's API.

Quick Start / 快速开始

Prerequisites / 前提条件:

  • Ensure Futu OpenD is running and HK quote entitlement is available.
  • 确保富途OpenD正在运行且拥有港股行情权限。
  • When running inside a restricted agent sandbox (for example OpenClaw/Codex exec), prefer host / elevated mode.
  • The Futu Python SDK may access local OpenD resources during import, including the user log directory under ~/.com.futunn.FutuOpenD/Log, so restricted sandboxes may fail before business functions are called.
  • 如果在受限的 agent 沙箱中运行(例如 OpenClaw/Codex exec),优先使用 host / elevated 模式。
  • 富途 Python SDK 在导入阶段就可能访问本机 OpenD 相关资源,包括 ~/.com.futunn.FutuOpenD/Log 下的日志目录;因此受限沙箱可能会在业务函数执行前就失败。

Setup Steps / 安装步骤:

  1. Install this skill via ClawHub (if not installed yet):
   clawhub install futu-trading-bot
  1. Enter the skill folder (default OpenClaw workspace path):
   cd ~/.openclaw/workspace/skills/futu-trading-bot

If you installed to a different location, cd into that folder instead.

  1. Create virtual environment (recommended):
   python3 -m venv .venv
   source .venv/bin/activate
  1. Install package:
   pip install -e .
  1. Configure credentials:
   cp json/config_example.json json/config.json
   # Edit json/config.json with your Futu credentials
   # 编辑json/config.json填写你的富途账户信息

依赖项

本技能通过 pip install -e . 自动安装以下核心 Python 包:

  • futu-api(富途 SDK)
  • pydantic(数据校验)

更多依赖请以 pyproject.toml / requirements.txt 为准。

Module Map

  • Account: account_manager

- get_account_info() - unlock_trade(password=None, password_md5=None) - lock_trade()

  • Quote: quote_service

- Stage 1: get_stock_basicinfo, get_market_state - Stage 2: subscribe, unsubscribe, unsubscribe_all, query_subscription, callbacks - Stage 3: get_market_snapshot, get_cur_kline, request_history_kline, get_rt_ticker - Stage 4: start_quote_stream, start_orderbook_stream

  • Trade: trade_service

- submit_order, modify_order, cancel_order, cancel_all_orders

  • Strategy Runtime: strategy_runtime

- run_strategy

  • Strategy Helpers: strategy

- in-memory state - trade guard / lock - trading window and cooldown helpers

Standard Workflow

  1. Run preflight_check first to verify config, OpenD connectivity, and sandbox/runtime readiness.
  2. Call get_account_info() and select target account (get acc_id).
  3. Pull quote/snapshot for the target symbol (default HK use case: HK.00700).
  4. For real trading, call unlock_trade(...) (password from config or input).
  5. Submit or manage orders with explicit acc_id and trd_env.
  6. After real operation, call lock_trade() if needed.

Connection Lifecycle

  • Pull-style quote functions such as get_market_snapshot, get_stock_basicinfo, get_market_state, get_cur_kline, request_history_kline, and get_rt_ticker now close their quote context automatically after returning.
  • Trade functions such as submit_order, modify_order, and cancel_all_orders now close their trade/quote contexts automatically after returning.
  • Account functions such as get_account_info, unlock_trade, and lock_trade now close their contexts automatically after returning.
  • Subscription/callback flows keep the quote context open on purpose. For subscribe, unsubscribe, unsubscribe_all, query_subscription, set_quote_callback, and set_orderbook_callback, call close_quote_service() explicitly when you are done with the session.

Canonical Imports

# Always use these import paths – do not import from futu directly
from preflight_check import run_preflight
from strategy import (
    StrategyState, TradeGuard, in_trading_window,
    trading_window_status, cooldown_elapsed, holding_timeout_exceeded
)
from strategy_runtime import run_strategy
from account_manager import get_account_info, unlock_trade, lock_trade
from quote_service import (
    get_stock_basicinfo, get_market_state, get_market_snapshot,
    get_cur_kline, request_history_kline, get_rt_ticker,
    subscribe, unsubscribe, unsubscribe_all, query_subscription,
    set_quote_callback, set_orderbook_callback,
    start_quote_stream, start_orderbook_stream
)
from trade_service import submit_order, modify_order, cancel_order, cancel_all_orders

Account Usage

Preflight

preflight = run_preflight()
if not preflight["success"]:
    print(preflight)
    raise SystemExit("Preflight failed")
# Get list of accounts
info = get_account_info()
if info['success']:
    accounts = info['accounts']
    print(accounts)

# Unlock trade (uses password from config or provided)
unlock_trade()  # will prompt for password if not configured
# Or with explicit password:
# unlock_trade(password="your_password")

# Lock trade
lock_trade()

Quote Usage

Basic Info / Market State

get_stock_basicinfo(market="HK", sec_type="STOCK", code_list=["HK.00700"])
get_market_state(["HK.00700"])

Snapshot (no subscription needed)

snap = get_market_snapshot(["HK.00700"])
if snap['success']:
    price = snap['data'][0]['last_price']

K-Line

# Current K-line (requires subscription, will auto-subscribe if needed)
kline = get_cur_kline(code="HK.00700", num=5, ktype="K_DAY", autype="QFQ")

# Historical K-line
hist = request_history_kline(
    code="HK.00700",
    start="2026-02-20",
    end="2026-03-06",
    ktype="K_DAY"
)

Ticker

tickers = get_rt_ticker(code="HK.00700", num=10)

Subscription & Callbacks

def on_quote(payload):
    print(payload)

set_quote_callback(on_quote)
subscribe(["HK.00700"], ["QUOTE"], is_first_push=True, subscribe_push=True)
query_subscription()
unsubscribe(["HK.00700"], ["QUOTE"])
unsubscribe_all()
close_quote_service()

Unified Stream Startup

def on_quote(payload):
    print(payload)

start_quote_stream(["HK.00700"], on_quote)

Strategy Helpers

state = StrategyState()
guard = TradeGuard()

if in_trading_window(start_time="09:30", end_time="16:00"):
    with guard.locked():
        pass

Trade Usage

# Submit an order
result = submit_order(
    code="HK.00700",
    side="BUY",
    qty=200,
    acc_id=6017237,               # from get_account_info
    trd_env="SIMULATE",            # or "REAL"
    price=150,                     # required for LIMIT order
    order_type="NORMAL",
)

# Modify order (change price/quantity)
modify_order(
    op="NORMAL",
    order_id="123456789",
    trd_env="SIMULATE",
    price=151,
    qty=200,
    acc_id=6017237
)

# Cancel a single order
cancel_order(order_id="123456789", trd_env="SIMULATE", acc_id=6017237)

# Cancel all orders
cancel_all_orders(trd_env="SIMULATE", acc_id=6017237)

Running a Background Trading Strategy (Using System Tools)

This skill does not manage long-running processes internally. Instead, you (the agent) should use system tools (e.g., exec, write, kill) to run strategy scripts in the background. This keeps the skill simple and leverages the platform's process management.

4.1 Workflow for Background Strategies

  1. Run preflight first with PYTHONPATH=src python -m preflight_check.
  2. If preflight reports sandbox/log-directory restrictions, rerun in host / elevated mode before using quote/trade functions.
  3. Generate a Python script based on user's natural language request, using the encapsulated functions from this skill (e.g., start_quote_stream, submit_order, run_strategy).
  4. Save the script to a temporary file (using the write tool or similar).
  5. Launch the script as a background process using the exec tool, redirecting output to a log file.
  6. Record the process ID (PID) and log file path for future monitoring.
  7. Monitor/stop using system tools (ps, kill, cat).

4.2 Natural Language Triggers

User RequestAgent Action
“Start a strategy to monitor Tencent, buy below 540, sell above 550”Generate script → save → launch with exec → return PID and log path
“How is my strategy doing?”Read log file (e.g., tail -n 20 logfile) → summarize
“Stop my strategy”Kill process using PID via kill tool

4.3 Script Template (for Agent Reference)

When generating a strategy script, use the following template. It handles signals, logging, and state persistence correctly.

#!/usr/bin/env python3
import sys
import time
import json
import os
import signal
import logging
from pathlib import Path

# If you installed the skill with `pip install -e .`, you can import modules directly.
# Only use sys.path/PYTHONPATH hacks when you didn't install the package.

from trade_service import submit_order
from quote_service import get_market_snapshot

# ===== Strategy parameters – fill by agent =====
# Replace these placeholders with your own strategy settings.
SYMBOL = "HK.00700"
ACC_ID = 0                 # fill from get_account_info()
TRD_ENV = "SIMULATE"       # default to SIMULATE; use REAL only with explicit confirmation
QTY = 0                    # position sizing / order quantity
LOG_FILE = Path("strategy.log")
PID_FILE = Path("strategy.pid")
# ===============================================

logging.basicConfig(
    filename=LOG_FILE,
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s'
)

# Handle termination signals
def handle_exit(signum, frame):
    logging.info("Received signal, stopping strategy")
    sys.exit(0)

signal.signal(signal.SIGTERM, handle_exit)
signal.signal(signal.SIGINT, handle_exit)

# Write PID file
with open(PID_FILE, "w") as f:
    f.write(str(os.getpid()))

logging.info(f"Strategy started: {SYMBOL}")

try:
    while True:
        snap = get_market_snapshot([SYMBOL])
        if not snap["success"]:
            logging.error(f"Quote failed: {snap['message']}")
            time.sleep(60)
            continue
        price = snap["data"][0]["last_price"]
        logging.info(f"Current price: {price}")

        # --- Insert your strategy logic here ---
        # Decide whether to trade based on your own signals/logic, then call submit_order(...).

        time.sleep(60)   # check every minute
except Exception as e:
    logging.exception("Strategy crashed")
finally:
    if PID_FILE.exists():
        PID_FILE.unlink()

4.4 Agent Execution Steps

User: “Start a range strategy for Tencent, buy below 540, sell above 550.”

Agent:

  1. Get account ID via get_account_info().
  2. Generate script using the template above, filling in parameters.
  3. Save script to a file, e.g., range_00700.py, using write tool.
  4. Launch background process using exec:
   cd /path/to/workspace
   nohup .venv/bin/python range_00700.py > strategy.out 2>&1 &

(Capture the PID from output.)

  1. Record PID and log path.
  2. Reply: “Strategy started. PID: 12345, log file: strategy_00700.log. You can check status or stop it anytime.”

4.5 Check Status

User: “How is my strategy doing?”

Agent:

  • Read last lines of log: tail -n 20 strategy_00700.log.
  • Check if process still running: ps -p 12345.
  • Summarize: “Strategy is running, last price was 542.5 at 10:30.”

4.6 Stop Strategy

User: “Stop my strategy.”

Agent:

  • Send SIGTERM: kill 12345.
  • Verify process ended, clean up PID file if needed.
  • Reply: “Strategy stopped.”

Error Handling

  • All functions return a dictionary with at least success (bool) and message (str).
  • On success, additional fields like data or order_id may be present.
  • Always check success first before using other fields.

Example:

result = submit_order(...)
if result["success"]:
    print(f"Order ID: {result['order_id']}")
else:
    print(f"Error: {result['message']}")

If OpenD connection fails, recheck:

  • OpenD is running (check port 11111 with lsof -i :11111)
  • Host/port in config.json matches OpenD
  • Account has necessary permissions

If the skill fails before quote/trade functions are even called, recheck:

  • Whether the current agent/tool is running in a restricted sandbox
  • Whether you should rerun in host / elevated mode
  • Whether the runtime can access the local Futu OpenD log directory under ~/.com.futunn.FutuOpenD/Log
  • Run PYTHONPATH=src python -m preflight_check first and follow its suggestions

Configuration

  • Config file: json/config.json
  • Required fields:

- futu_api.host (default: 127.0.0.1) - futu_api.port (default: 11111) - futu_api.security_firm (e.g., FUTUSECURITIES)

  • Password handling:

- Prefer trade_password_md5 (32‑char lowercase MD5) - Fallback to trade_password (will be MD5‑ed at runtime)

  • Account cache: json/account_info.json (auto‑generated after get_account_info)

📜 License

This skill is licensed under MIT-0 (MIT No Attribution).


Copyright © 2026 jeffersonling1217-png

平台分布

OpenClaw

96.06%
按下载量换算6,594

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills