← 返回 Skills 市场
LongPort Quant Trader
作者
fxm1618-gmail
· GitHub ↗
· v1.0.0
· MIT-0
113
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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 appears to be what it says: an automated LongPort trading toolkit that will read market data and can submit real orders if given your LongPort credentials. Before installing, consider: 1) Use a sandbox or simulated account to validate behavior (do not use real money until tested). 2) Do NOT commit API keys to source control — prefer environment variables or a secrets manager; if you follow the config.py suggestion, delete keys from disk afterward. 3) Limit the credentials' permissions if LongPort supports scoped tokens; use a read-only token or a test token where possible and rotate/revoke keys after testing. 4) Review the 'longport' Python package source (PyPI/GitHub) and examine any network calls if you require stronger assurance. 5) If you enable Feishu webhook notifications, treat webhooks as secrets. 6) Because the skill can place trades, run it on a dedicated device and monitor logs and order history closely to detect unexpected activity.
功能分析
Type: OpenClaw Skill
Name: longport-quant-trader
Version: 1.0.0
The skill bundle contains several high-risk security issues, most notably the inclusion of hardcoded API credentials and secrets. Specifically, 'config.json' contains LongPort API keys, and 'qqq_monitor_push.py' contains a hardcoded Feishu (Lark) App ID and Secret. Furthermore, 'get_openid_and_send.py' includes logic specifically designed to search for and target an individual named '房晓明' (Fang Xiaoming) within a Feishu tenant to send automated messages. While these may be remnants of a specific development or testing environment, the presence of hardcoded secrets and targeted messaging logic is highly irregular for a general-purpose skill and poses a significant risk of credential exposure and unauthorized communication.
能力评估
Purpose & Capability
Name/description (LongPort quantitative trader) align with the code and requirements: code imports longport.openapi, submits orders, monitors quotes, and sends Feishu notifications. Required env vars are LongPort credentials which are expected for this purpose. Required binary (python3) and pip dependencies (longport, python-dotenv) are appropriate.
Instruction Scope
SKILL.md and SETUP_GUIDE instruct running monitoring/trading scripts (e.g., quant_monitor.py, hk_scanner_full.py) and storing API keys either as env vars or in a config.py/.env. The runtime instructions and code do perform account queries and order submission (expected), and write local state files (e.g., /tmp/auto_trade_state.json). Minor inconsistency: SKILL.md shows editing config.py while most code uses Config.from_env() and dotenv — this may lead users to store secrets on disk if they follow the config.py guidance. No instructions request unrelated files, credentials, or external endpoints beyond LongPort and optional Feishu.
Install Mechanism
Install spec only bootstraps Python via Homebrew ([email protected]). SKILL.md also instructs pip installing 'longport' and 'python-dotenv' (expected). There are no downloads from untrusted URLs or archive extraction in the install spec. Overall install approach is proportionate.
Credentials
Declared required env vars are LONGPORT_APP_KEY, LONGPORT_APP_SECRET, LONGPORT_ACCESS_TOKEN — these map directly to the trading API and are necessary for automated trading. No unrelated credentials are requested. Note: those credentials allow placing real trades; the skill's access is powerful and should be limited to appropriate accounts (use sandbox/test keys if available). Feishu webhook is optional and not listed as required.
Persistence & Privilege
Skill is not marked always:true and uses normal autonomous invocation. It creates/writes small local state and performance files under /tmp (and suggests local config/.env). It does not request system-wide configuration changes or modify other skills. Autonomous invocation combined with trading credentials implies high potential impact (financial) but that impact is coherent with the stated purpose.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install longport-quant-trader - 安装完成后,直接呼叫该 Skill 的名称或使用
/longport-quant-trader触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
longport-quant-trader v1.0.0
- 首次发布版本,集成港股/美股自动量化交易。
- 支持超跌抄底与动量追涨策略,内置止盈止损管理。
- 提供飞书推送功能,监控结果和绩效实时推送。
- 每 5 分钟自动市场扫描,智能捕捉买卖机会。
- 支持绩效跟踪、个性化参数配置和自定义股票池。
元数据
常见问题
LongPort Quant Trader 是什么?
长桥证券量化交易集成 - 自动超跌/动量策略 + 飞书推送 + 绩效跟踪。支持港股/美股自动交易,每 5 分钟监控,止盈止损管理。适用于想要自动化交易的个人投资者和量化爱好者。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 113 次。
如何安装 LongPort Quant Trader?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install 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