← Back to Skills Marketplace
fxm1618-gmail

LongPort Quant Trader (房总版)

by fxm1618-gmail · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
106
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install fxm1618-longport-quant-trader
Description
长桥证券量化交易集成 - 自动超跌/动量策略 + 飞书推送 + 绩效跟踪。支持港股/美股自动交易,每 5 分钟监控,止盈止损管理。适用于想要自动化交易的个人投资者和量化爱好者。
README (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 笔交易

安全提示

⚠️ 重要:

  1. 保护 API 密钥,不要提交到 git
  2. 模拟盘测试后再实盘
  3. 设置合理的止盈止损
  4. 定期备份配置文件

技术支持

  • 邮箱:[email protected]
  • 微信:quant_trader
  • 文档:https://github.com/yourname/longport-quant-trader

更新日志

v1.0.0 (2026-03-05)

  • 🎉 首次发布
  • ✅ 超跌/动量策略
  • ✅ 飞书推送集成
  • ✅ 绩效跟踪系统

免责声明: 本软件仅供学习研究,不构成投资建议。使用本软件进行交易需自行承担风险。

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fxm1618-longport-quant-trader
  3. After installation, invoke the skill by name or use /fxm1618-longport-quant-trader
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
longport-quant-trader v1.0.0 – Initial Release - 自动化港股/美股超跌抄底与动量追涨策略 - 集成飞书推送,实时通知与绩效报告 - 内置止盈止损机制,自动仓位管理 - 提供交易绩效跟踪与定时市场扫描(每5分钟) - 支持通过命令启动监控、查持仓、配置参数、生成报告
Metadata
Slug fxm1618-longport-quant-trader
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is LongPort Quant Trader (房总版)?

长桥证券量化交易集成 - 自动超跌/动量策略 + 飞书推送 + 绩效跟踪。支持港股/美股自动交易,每 5 分钟监控,止盈止损管理。适用于想要自动化交易的个人投资者和量化爱好者。 It is an AI Agent Skill for Claude Code / OpenClaw, with 106 downloads so far.

How do I install LongPort Quant Trader (房总版)?

Run "/install fxm1618-longport-quant-trader" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is LongPort Quant Trader (房总版) free?

Yes, LongPort Quant Trader (房总版) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does LongPort Quant Trader (房总版) support?

LongPort Quant Trader (房总版) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created LongPort Quant Trader (房总版)?

It is built and maintained by fxm1618-gmail (@fxm1618-gmail); the current version is v1.0.0.

💬 Comments