← 返回 Skills 市场
LongPort Quant Trader (房总版)
作者
fxm1618-gmail
· GitHub ↗
· v1.0.0
· MIT-0
106
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fxm1618-longport-quant-trader
功能描述
长桥证券量化交易集成 - 自动超跌/动量策略 + 飞书推送 + 绩效跟踪。支持港股/美股自动交易,每 5 分钟监控,止盈止损管理。适用于想要自动化交易的个人投资者和量化爱好者。
使用说明 (SKILL.md)
longport-quant-trader v1.0
长桥证券量化交易集成 - 自动化港股/美股交易
核心功能
- 📈 超跌抄底策略 - 自动检测跌幅>2.5% 的股票并买入
- 🚀 动量追涨策略 - 自动检测涨幅>1.5% 的股票并跟进
- 🎯 自动止盈止损 - +15% 止盈 / -8% 止损
- 📱 飞书推送 - 实时交易通知和绩效报告
- 📊 绩效跟踪 - 胜率/收益/回撤自动统计
- ⏰ 定时监控 - 每 5 分钟自动扫描市场
快速开始
1. 安装依赖
pip install longport python-dotenv
2. 配置 API 密钥
在 config.py 中填写长桥 API 凭证:
LONGPORT_APP_KEY = "your_app_key"
LONGPORT_APP_SECRET = "your_app_secret"
LONGPORT_ACCESS_TOKEN = "your_access_token"
从 https://open.longportapp.com/account 获取
3. 配置飞书推送(可选)
FEISHU_BOT_WEBHOOK = "your_webhook_url"
4. 启动监控
python quant_monitor.py
策略参数
| 参数 | 默认值 | 说明 |
|---|---|---|
| momentum_threshold | +1.5% | 动量买入阈值 |
| reversion_threshold | -2.5% | 超跌买入阈值 |
| take_profit | +15% | 止盈阈值 |
| stop_loss | -8% | 止损阈值 |
| position_size_pct | 25% | 单笔仓位比例 |
| max_positions | 5 | 最大持仓数 |
股票池
默认港股池:
- 700.HK 腾讯控股
- 9988.HK 阿里巴巴
- 3690.HK 美团
- 1211.HK 比亚迪
- 9618.HK 京东
可扩展: 支持自定义股票池
输出示例
🔄 监控 - 14:30:00
======================================================================
💰 现金:HKD 51,320 | 净资产:HKD 798,261
📈 持仓 (3)
9988.HK: 200 股 盈亏 HKD -20 (-0.08%)
700.HK: 100 股 盈亏 HKD -1,100 (-2.14%)
1211.HK: 600 股 盈亏 HKD -450 (-0.81%)
🔍 买入机会
🟢 3690.HK 超跌 -2.8% 买入 200 股 @ HKD 73.50
✅ 订单 ID: 1214093530725662720
📊 绩效
交易:3 笔
胜率:66.7% (2 胜 1 负)
收益:+0.52%
✅ 执行 1 笔交易
安全提示
⚠️ 重要:
- 保护 API 密钥,不要提交到 git
- 模拟盘测试后再实盘
- 设置合理的止盈止损
- 定期备份配置文件
技术支持
- 邮箱:[email protected]
- 微信:quant_trader
- 文档:https://github.com/yourname/longport-quant-trader
更新日志
v1.0.0 (2026-03-05)
- 🎉 首次发布
- ✅ 超跌/动量策略
- ✅ 飞书推送集成
- ✅ 绩效跟踪系统
免责声明: 本软件仅供学习研究,不构成投资建议。使用本软件进行交易需自行承担风险。
安全使用建议
This skill is coherent for automated trading, but granting it your LongPort API credentials permits live order submission — treat them like real-money keys. Before using in production: 1) Test thoroughly on the provider's sandbox/simulated account (use a sandbox access token if available). 2) Review and run the code in an isolated environment (dedicated machine/container) to protect keys and state files. 3) Keep secrets out of source control (.env and shell rc files), rotate keys if exposed, and consider creating a LongPort token/account scoped to limited permissions if the platform supports it. 4) Be aware the bot persists state and logs (/tmp and logs/...), so secure or clean those files if needed. 5) If you don't trust the publisher, inspect all scripts (especially those that send data externally) before providing credentials.
功能分析
Type: OpenClaw Skill
Name: fxm1618-longport-quant-trader
Version: 1.0.0
The skill bundle contains a significant amount of hardcoded sensitive information, including LongPort API keys, Feishu (Lark) App IDs, and App Secrets in files like config.json and qqq_monitor_push.py. Most concerning is the hardcoding of a specific Feishu OpenID (ou_c3f01a621b3fef9a2b59368233bf7647) across multiple scripts (lianghui_monitor.py, qqq_monitor_push.py), which would cause the agent to send trading notifications and potentially sensitive data to a specific third party by default. Additionally, get_openid_and_send.py is a highly specific script designed to target an individual named 'Fang Xiaoming'. While these appear to be developer artifacts rather than an intentional attack on the end-user, the presence of active credentials and hardcoded exfiltration targets poses a severe security risk.
能力评估
Purpose & Capability
Name/description (LongPort quantitative trader) align with required binaries (python3), required env vars (LONGPORT_APP_KEY, LONGPORT_APP_SECRET, LONGPORT_ACCESS_TOKEN), and the included Python code which calls longport.openapi for market data and order submission.
Instruction Scope
The SKILL.md instructs typical setup steps (pip install longport, set env vars, run quant_monitor.py). Runtime code legitimately reads env vars, queries quotes, and submits orders. Note: multiple scripts persist state to /tmp (e.g., /tmp/auto_trade_state.json, /tmp/auto_trade_performance.json) and write logs (logs/quant_monitor.log) — expected for a trading bot but worth being aware of because these files hold trading state and should be protected.
Install Mechanism
Install spec only ensures python3 via Homebrew ([email protected]) which is reasonable. The README/SKILL.md also instructs pip installing third-party packages (longport, python-dotenv) but that pip install is not encoded in the install spec — it's a normal omission but means the environment must run pip to install dependencies before use.
Credentials
Only LongPort API credentials are required (LONGPORT_APP_KEY, LONGPORT_APP_SECRET, LONGPORT_ACCESS_TOKEN), which are directly relevant. Optional Feishu webhook config is documented but not required. No unrelated tokens or high-privilege credentials are requested.
Persistence & Privilege
Skill is not always-enabled and uses normal agent invocation. It stores state and performance data to local files under /tmp and logs; it does not request or modify other skills or system-level configurations. This persistence is typical for a trading bot.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install fxm1618-longport-quant-trader - 安装完成后,直接呼叫该 Skill 的名称或使用
/fxm1618-longport-quant-trader触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
longport-quant-trader v1.0.0 – Initial Release
- 自动化港股/美股超跌抄底与动量追涨策略
- 集成飞书推送,实时通知与绩效报告
- 内置止盈止损机制,自动仓位管理
- 提供交易绩效跟踪与定时市场扫描(每5分钟)
- 支持通过命令启动监控、查持仓、配置参数、生成报告
元数据
常见问题
LongPort Quant Trader (房总版) 是什么?
长桥证券量化交易集成 - 自动超跌/动量策略 + 飞书推送 + 绩效跟踪。支持港股/美股自动交易,每 5 分钟监控,止盈止损管理。适用于想要自动化交易的个人投资者和量化爱好者。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 106 次。
如何安装 LongPort Quant Trader (房总版)?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install fxm1618-longport-quant-trader」即可一键安装,无需额外配置。
LongPort Quant Trader (房总版) 是免费的吗?
是的,LongPort Quant Trader (房总版) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
LongPort Quant Trader (房总版) 支持哪些平台?
LongPort Quant Trader (房总版) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 LongPort Quant Trader (房总版)?
由 fxm1618-gmail(@fxm1618-gmail)开发并维护,当前版本 v1.0.0。
推荐 Skills